0 votes

i just start godot few day ago still cant solve this problem

extends KinematicBody2D

var movement = Vector2()
var movement_speed = 100

func _ready():

func _physics_process(delta):
    movement.x = Input.is_action_pressed("ui_right") - Input.is_action_pressed("ui_right")
    movement.y = Input.is_action_pressed("ui_down") - Input.is_action_pressed("ui_up")
    movement = movement.normalized()
    var motion = movement * movement_speed * delta
asked Jul 27, 2018 in Projects by potatobanana (162 points)
edited Jul 27, 2018 by volzhs

1 Answer

+1 vote
Best answer

you can do it with int()

int(true) - int(false)
answered Jul 27, 2018 by volzhs (9,320 points)
selected Aug 3, 2018 by potatobanana

thanks worked for me

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.