]> Untitled Git - frog-ninja.git/blobdiff - player/moves/dash.gd
Separated the Visual from the Model
[frog-ninja.git] / player / moves / dash.gd
index aaf7081b1837fcfe383dbdc2dbb0eb377fa4b80f..cfdfa77296d2399957a94bfe66ccdcd2af1956d1 100644 (file)
@@ -1,6 +1,7 @@
 extends Move
 class_name Dash
 
+@export var dash_length := 10.0
 
 @onready var timer: Timer = $Timer
 
@@ -12,7 +13,7 @@ func should_enter(input: InputPacket) -> String:
        if finished:
                input.actions.sort_custom(moves_priority_sort)
                return input.actions[0]
-       return "dash"
+       return state_name
 
 
 func update(_input: InputPacket, delta: float):
@@ -24,8 +25,7 @@ func update(_input: InputPacket, delta: float):
 
 
 func on_enter_state():
-       player.skin.transition_dash()
-       new_position = player.global_position + player.last_movement_direction * player.dash_length
+       new_position = player.global_position + player.last_movement_direction * dash_length
        finished = false
        timer.start()