Files
sidescroller-project/sidescroller/scripts/playerwallrunpushoff.gd

28 lines
607 B
GDScript3
Raw Normal View History

2025-06-11 17:54:55 +02:00
extends State
class_name PlayerWallrunPushoff
func get_state_name():
return str(self).split(":")[0]
func enter():
player.v_mult = player.wallpushoff_mult
player.v_push = -player.facing_direction * player.wallpushoff_force
print("pushoff entered")
func exit():
player.wallpushoff_timer = 0.0
player.v_mult = 1
player.v_push = 0
player.set_facing_direction(-player.facing_direction)
func update(delta):
pass
func physics_update(delta):
player.movement()
player.wallpushoff_timer += delta
if player.wallpushoff_timer >= player.wallpushoff_time:
Transitioned.emit(self, "PlayerFall")