no message
This commit is contained in:
27
sidescroller/scripts/playerwallrunpushoff.gd
Normal file
27
sidescroller/scripts/playerwallrunpushoff.gd
Normal file
@ -0,0 +1,27 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user