Allow easy killing (with animation) of anything that has a DR. Useful for plausibly disposing of projectiles.

This commit is contained in:
stevenhowes
2022-03-27 17:13:18 +01:00
parent 428e2d175c
commit 61b8cecc0b
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -25,6 +25,9 @@ func (dr *damageReceiver) onDraw() error {
}
func (dr *damageReceiver) onUpdate() error {
if dr.container.Kill {
dr.health = -1
}
// If we're out of health
if dr.health <= 0 {
// If we have an animator, run the destroy sequence