collision work
This commit is contained in:
+1
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user