summaryrefslogtreecommitdiff
path: root/character_body_2d.gd
diff options
context:
space:
mode:
Diffstat (limited to 'character_body_2d.gd')
-rw-r--r--character_body_2d.gd17
1 files changed, 17 insertions, 0 deletions
diff --git a/character_body_2d.gd b/character_body_2d.gd
new file mode 100644
index 0000000..62298c0
--- /dev/null
+++ b/character_body_2d.gd
@@ -0,0 +1,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.