28 lines
607 B
GDScript
28 lines
607 B
GDScript
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")
|