You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
603 B
GDScript

extends Node
class_name PlayerStanding
const speed_scale = 1
const animation_name = "standing up"
func input(actor):
actor.show()
pass
func process(actor):
actor.get_animated_sprite().animation = animation_name
actor.get_animated_sprite().speed_scale = speed_scale
actor.get_animated_sprite().flip_h = actor.velocity.x < 0
func physics_process(actor, delta):
var collision = actor.move_and_collide(Vector2(0.0, 0.0) * delta)
if collision:
collision.collider.on_collide(actor)
func sprite_finished(actor):
actor.state = actor.PlayerState.NORMAL
actor.get_animated_sprite().flip_h = false