collision work

This commit is contained in:
Fraser Graham
2013-10-21 07:49:56 -07:00
parent 200afffa7f
commit c910902d38
2 changed files with 22 additions and 10 deletions
+1 -3
View File
@@ -31,9 +31,7 @@ func (p *Projectile) Tick(g *game) {
}
// Are we going to intersect the destination zone in this tick?
r_dest := v.Rect2d{
A: v.Point2d{X: p.MoveTo.X - 3, Y: p.MoveTo.Y - 3},
B: v.Point2d{X: p.MoveTo.X + 3, Y: p.MoveTo.Y + 3}}
r_dest := v.RectFromPoint(p.MoveTo, 3.0)
travel := newPos.Sub(p.Position)
arrived, _, _ := v.RectIntersection(r_dest, p.Position, travel)