Commit of existing data.
This commit is contained in:
Executable
+54
@@ -0,0 +1,54 @@
|
||||
extends AnimatedSprite2D
|
||||
|
||||
@onready var player := $".." as Player
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
play("default")
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
match player.state:
|
||||
Player.States.IDLE:
|
||||
play("default")
|
||||
Player.States.RUN_START:
|
||||
play("run_start")
|
||||
Player.States.RUN:
|
||||
play("run")
|
||||
Player.States.ROLL:
|
||||
play("roll")
|
||||
Player.States.JUMP_START:
|
||||
play("jump_start")
|
||||
Player.States.JUMP:
|
||||
play("jump")
|
||||
Player.States.FALL:
|
||||
play("fall")
|
||||
Player.States.LAND:
|
||||
play("land")
|
||||
Player.States.DAMAGE:
|
||||
play("damage")
|
||||
Player.States.RAGDOLL:
|
||||
play("knockdown")
|
||||
Player.States.BOUNCE:
|
||||
play("knockdown")
|
||||
if player.is_on_floor():
|
||||
frame = 4
|
||||
Player.States.LAY:
|
||||
play("lay")
|
||||
if player.direction:
|
||||
flip_h = player.direction < 0
|
||||
|
||||
func _on_animation_finished():
|
||||
match animation:
|
||||
"run_start":
|
||||
player.state = Player.States.RUN
|
||||
"land":
|
||||
player.state = Player.States.IDLE
|
||||
"jump_start":
|
||||
player.state = Player.States.JUMP
|
||||
"roll":
|
||||
player.state = Player.States.IDLE
|
||||
"damage":
|
||||
player.state = Player.States.IDLE
|
||||
Reference in New Issue
Block a user