collisions should kill bubbles
This commit is contained in:
parent
c551ebd55a
commit
df80802307
1 changed files with 5 additions and 13 deletions
|
@ -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(
|
||||
//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)
|
||||
}
|
||||
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...
|
||||
b.Sprite.Actor.MoveZ(float64(rand.Intn(2)-rand.Intn(2)), die)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue