From 77cde6fcb20834ff35ff5a5706d61dfd1e29cb4b Mon Sep 17 00:00:00 2001 From: SondreElg Date: Sat, 4 Oct 2025 12:51:45 +0200 Subject: [PATCH] fix: player movement --- growth/player.gd | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/growth/player.gd b/growth/player.gd index 1568947..b7df02c 100644 --- a/growth/player.gd +++ b/growth/player.gd @@ -59,6 +59,8 @@ func _ready(): screen_size = get_viewport_rect().size func _process(delta): + if (moveState != MoveState.Dashing): + updateMoveDirection(); if (dashOnCooldown): dashCooldownTime += delta; if (dashCooldownTime >= dashCooldown): @@ -68,19 +70,16 @@ func _process(delta): if moveState == MoveState.Loading: null # Idk dude, thought it might be a fun effect when you take damage - elif moveState != MoveState.Dashing: - updateMoveDirection(); - velocity = moveDirection.normalize() * speed; - - if velocity.x || velocity.y: - moveState = MoveState.Moving; - elif moveState != MoveState.Dashing: - moveState = MoveState.Still; elif Input.is_action_pressed("dash") or actionState == MoveState.Dashing: - if (moveState != MoveState.Dashing): - updateMoveDirection(); moveState = MoveState.Dashing; dash(delta); + else: + velocity = moveDirection.normalize() * speed; + if velocity.x || velocity.y: + moveState = MoveState.Moving; + else: + moveState = MoveState.Still; + # Handle actionState if Input.is_action_pressed("deploy"):