collisions should kill bubbles

This commit is contained in:
Josh Deprez 2021-10-01 13:18:58 +10:00
parent c551ebd55a
commit df80802307

View file

@ -73,18 +73,10 @@ func (b *Bubble) Update() error {
if b.Life <= 0 {
b.game.PathUnregister(b)
}
if true {
// not using MoveX/MoveY/... because collisions are unnecessary -
// this is an effect particle; if it overlaps a solid, who cares
b.Sprite.Actor.Pos = b.Sprite.Actor.Pos.Add(geom.Pt3(
die := func() { b.Life = 0 }
b.Sprite.Actor.MoveX(float64(rand.Intn(3)-1), die)
b.Sprite.Actor.MoveY(-1, die)
//lint:ignore SA4000 one random minus another is not always zero...
rand.Intn(3)-1, -1, rand.Intn(2)-rand.Intn(2),
))
} else {
b.Sprite.Actor.MoveX(float64(rand.Intn(3)-1), nil)
b.Sprite.Actor.MoveY(-1, nil)
//lint:ignore SA4000 one random minus another is not always zero...
b.Sprite.Actor.MoveZ(float64(rand.Intn(2)-rand.Intn(2)), nil)
}
b.Sprite.Actor.MoveZ(float64(rand.Intn(2)-rand.Intn(2)), die)
return nil
}