29 lines
651 B
GDScript
29 lines
651 B
GDScript
extends State
|
|
class_name PlayerRun
|
|
|
|
func get_state_name():
|
|
return str(self).split(":")[0]
|
|
|
|
func enter():
|
|
player.air_jumps_done = 0
|
|
player.wallrun_available = true
|
|
player.v_mult = 1
|
|
func exit():
|
|
pass
|
|
func update(delta):
|
|
player.ap.play("run")
|
|
|
|
if player.transitionidle():
|
|
Transitioned.emit(self, "PlayerIdle")
|
|
elif player.transitioncrouch():
|
|
Transitioned.emit(self, "PlayerCrouchwalk")
|
|
elif player.transitionwallrun():
|
|
Transitioned.emit(self, "PlayerWallrun")
|
|
elif player.transitionjump():
|
|
Transitioned.emit(self, "PlayerJump")
|
|
elif player.transitionfall():
|
|
Transitioned.emit(self, "PlayerFall")
|
|
|
|
func physics_update(delta):
|
|
pass
|