ft: made sprite behaviour consistent across entities

This commit is contained in:
djaidjai committed 2026-03-07 13:12:18 +01:00
1 parent da15fb77a2
commit 1fbc2f6637
9 files changed
+21 -16

No files matched your search

@@ -15,8 +15,7 @@ var can_attack: bool = true
func _ready() -> void:
health = maxHealth
sprite.play("Healthy") # TODO: sprite play logic (esp wrt state switching)
wrapper.play_sprite("Healthy")
play_sprite(idle_sprite)
if starting_pos:
collision.set_position(starting_pos)
@@ -61,8 +60,8 @@ func die() -> void:
super.die()
func become_injured() -> void:
sprite.play("Hurt")
wrapper.play_sprite("Hurt")
idle_sprite = "Hurt"
play_sprite(idle_sprite)
func _on_sight_body_entered(body: Node2D) -> void:
if fsm.map(fsm.state) != fsm.States.HUNTING and body.is_in_group("prey") or (health < maxHealth and body.is_in_group("player")):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.