You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Babushka/scripts/player.gd

21 lines
586 B

extends Node2D
@export var speed: float = 100.0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if(Input.is_action_pressed("move_right")):
position.x += speed * delta
if(Input.is_action_pressed("move_left")):
position.x -= speed * delta
if(Input.is_action_pressed("move_up")):
position.y -= speed * delta
if(Input.is_action_pressed("move_down")):
position.y += speed * delta
pass