Animaciones

mail@pastecode.io avatar
unknown
plain_text
a month ago
436 B
3
Indexable
Never
if is_on_floor() and health > 0 and !isHurt:
		if velocity == Vector2.ZERO:
			sprite.animation = "Idle"
		else:
			sprite.animation = "Running"
	elif !is_on_floor() and health > 0 and !isHurt:
		if velocity.y < 0:
			sprite.animation = "Jumping"
		else:
			sprite.animation = "Falling"
	elif isHurt:
		sprite.animation = "Hurt"
		wait_for_anim()
	if health == 0:
		sprite.animation = "Dying"
		set_physics_process(false)
Leave a Comment