ft: made sprite behaviour consistent across entities
This commit is contained in:
@@ -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