26 lines
487 B
GDScript
26 lines
487 B
GDScript
extends State
|
|
class_name PlayerDash
|
|
|
|
func get_state_name():
|
|
return str(self).split(":")[0]
|
|
|
|
func enter():
|
|
player.dash_available = false
|
|
player.direction_locked = true
|
|
player.v_mult = player.dash_mult
|
|
player.velocity.y = 0
|
|
|
|
func exit():
|
|
player.direction_locked = false
|
|
player.v_mult = 1
|
|
player.dash_timer = 0
|
|
|
|
func update(delta):
|
|
pass
|
|
|
|
func physics_update(delta):
|
|
player.dash_timer += delta
|
|
|
|
if player.dash_timer >= player.dash_time:
|
|
Transitioned.emit(self, "PlayerFall")
|