summaryrefslogtreecommitdiff
path: root/character_body_2d.gd
blob: 62298c08b6cee06d5c34ffa79a5ae530eb2f07ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extends CharacterBody2D

const speed = 100.0
const JUMP_VELOCITY = -400.0

func _physics_process(delta: float) -> void:
	var direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
	
	# ADD THIS LINE TO DEBUG:
	print("Direction: ", direction, " | Velocity: ", velocity)
	
	velocity = direction * speed
	move_and_slide()


func _on_animation_player_current_animation_changed(anim_name: StringName) -> void:
	pass # Replace with function body.