Am I punching trees or pounding sand?

This commit is contained in:
2025-11-05 13:48:01 +11:00
parent b65134d283
commit cb85608dfe
5 changed files with 34 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
extends CharacterBody2D
class_name Character extends CharacterBody2D
var _grid_pos: Vector2i = Vector2i.ZERO
var _grid_tween: Tween = null
@@ -6,11 +6,10 @@ var _grid_tween: Tween = null
var _cached_dir: Vector2i = Vector2i.ZERO #used for reversing the current input
func _physics_process(delta: float) -> void:
#WARNING: this has the potential for getting stuck
if _grid_pos * 32 == Vector2i(position):
_check_grid_move(delta)
func _check_grid_move(delta: float) -> void:
func _check_grid_move(_delta: float) -> void:
if Input.is_action_pressed("input_north"):
_set_grid_move(Vector2i.UP)
elif Input.is_action_pressed("input_south"):