:( compile code before committing Fraser
This commit is contained in:
parent
4c4c0d4e67
commit
cacb8b547d
@ -51,15 +51,15 @@ func (p *Projectile) Tick(g *game) {
|
||||
arrived, _, pos := v.RectIntersection(r_dest, p.Position, travel)
|
||||
|
||||
if !arrived {
|
||||
for i, obj := range g.obstacles {
|
||||
for _, obj := range g.obstacles {
|
||||
collision, _, pos := v.RectIntersection(obj.Bounds, p.Position, travel)
|
||||
if collision {
|
||||
arrived = true
|
||||
p.Position = pos
|
||||
obj.Hp -= p.Damage
|
||||
if obj.Hp < 0 {
|
||||
delete(g.obstacles, i)
|
||||
}
|
||||
// if obj.Hp < 0 {
|
||||
// delete(g.obstacles, i)
|
||||
// }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user