:( compile code before committing Fraser

This commit is contained in:
Fraser Graham 2013-11-17 08:23:11 -08:00
parent 4c4c0d4e67
commit cacb8b547d

View File

@ -51,15 +51,15 @@ func (p *Projectile) Tick(g *game) {
arrived, _, pos := v.RectIntersection(r_dest, p.Position, travel) arrived, _, pos := v.RectIntersection(r_dest, p.Position, travel)
if !arrived { if !arrived {
for i, obj := range g.obstacles { for _, obj := range g.obstacles {
collision, _, pos := v.RectIntersection(obj.Bounds, p.Position, travel) collision, _, pos := v.RectIntersection(obj.Bounds, p.Position, travel)
if collision { if collision {
arrived = true arrived = true
p.Position = pos p.Position = pos
obj.Hp -= p.Damage obj.Hp -= p.Damage
if obj.Hp < 0 { // if obj.Hp < 0 {
delete(g.obstacles, i) // delete(g.obstacles, i)
} // }
} }
} }
} else { } else {