Skip to content

Commit

Permalink
Rework monster animation code #73: injured skin
Browse files Browse the repository at this point in the history
  • Loading branch information
demoth committed Sep 6, 2023
1 parent e0b2f73 commit 41353b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions game/src/main/kotlin/jake2/game/character/GameCharacter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class GameCharacter(

fun reactToDamage(damage: Int) {
health -= damage
if (health < 50) // injured skin threshold
self.s.skinnum = 1
if (health > 0)
stateMachine.attemptStateChange("pain")
else
Expand Down

0 comments on commit 41353b9

Please sign in to comment.