fix: dash lock

This commit is contained in:
SondreElg
2025-10-04 18:31:01 +02:00
parent dd07f52e34
commit e043302888

View File

@@ -13,7 +13,6 @@ var move_direction = Vector2.ZERO;
var velocity = Vector2.ZERO # The player's movement vector. var velocity = Vector2.ZERO # The player's movement vector.
var target = Vector2.ZERO # The position of the player's cursor. var target = Vector2.ZERO # The position of the player's cursor.
const drawpile = []; const drawpile = [];
const hand = []; const hand = [];
const discard_pile = []; const discard_pile = [];
@@ -67,7 +66,7 @@ func dash():
func play_card(): func play_card():
if active_card_index >= 0 and active_card_index < hand.size(): if active_card_index >= 0 and active_card_index < hand.size():
var card = hand[active_card_index]; var card = hand[active_card_index];
card.play(self, target); card.play(self);
func cycle_card(index_shift): func cycle_card(index_shift):
if hand.size() > 0: if hand.size() > 0:
@@ -115,12 +114,13 @@ func _process(delta):
if (dash_cooldown_timer >= dash_cooldown): if (dash_cooldown_timer >= dash_cooldown):
dash_on_cooldown = false; dash_on_cooldown = false;
dash_cooldown_timer = 0; dash_cooldown_timer = 0;
# handle move_state # handle move_state
if move_state == MoveState.Knockback: if move_state == MoveState.Knockback:
pass pass
elif Input.is_action_just_pressed("dash"): elif Input.is_action_just_pressed("dash"):
dash(); dash();
else: elif (move_state != MoveState.Dashing):
velocity = move_direction * speed; velocity = move_direction * speed;
if velocity.x || velocity.y: if velocity.x || velocity.y:
move_state = MoveState.Moving; move_state = MoveState.Moving;