Refactoring in explosion sounds.
This commit is contained in:
@@ -327,6 +327,13 @@ func (c *Canvas) UpdateEnemies() {
|
||||
for _, e := range c.enemies {
|
||||
if !c.gameover {
|
||||
e.SetTarget(c.hero.Pos)
|
||||
|
||||
if e.GetEnemyState() == gamedata.EnemyStateExploding && !e.ExplosionInitiated() {
|
||||
if c.eventmap[gamedata.GameEventExplosion] != nil {
|
||||
c.eventmap[gamedata.GameEventExplosion]()
|
||||
}
|
||||
e.SetExplosionInitiated()
|
||||
}
|
||||
} else {
|
||||
e.SetTarget(e.GetPosition())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user