newest Version as of right now
This commit is contained in:
25
sidescroller/scripts/playerdash.gd
Normal file
25
sidescroller/scripts/playerdash.gd
Normal file
@ -0,0 +1,25 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user