Fixed health bar positioning. Added fireball sfx.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user