Fixed health bar positioning. Added fireball sfx.

This commit is contained in:
2024-11-17 13:35:29 -05:00
parent e049e8c3d0
commit 1498865026
6 changed files with 32 additions and 15 deletions

View File

@@ -19,6 +19,7 @@ type FlyEye struct {
state gamedata.EnemyState
cycle int
dyingcount int
health int
hit bool
touched bool
toggle bool
@@ -30,6 +31,7 @@ func NewFlyEye() *FlyEye {
Sprite: ebiten.NewImage(46, 46),
Maks: ebiten.NewImage(48, 48),
MaksDest: ebiten.NewImage(48, 48),
health: 0,
cycle: 0,
dyingcount: 0,
hit: false,
@@ -124,6 +126,7 @@ func (f *FlyEye) SetHit() {
f.hit = true
f.state = gamedata.EnemyStateDying
f.cycle = 0
f.health--
}
func (f *FlyEye) IsTouched() bool {
@@ -165,7 +168,7 @@ func (f *FlyEye) SetExplosionInitiated() {
func (f *FlyEye) Health() int {
//health bars reserved for special enemies, flyeye is a one
//hitter so returning zero ensure no health bar is rendered
return 0
return f.health
}
func (f *FlyEye) MaxHealth() int {