Ah, the linear equation. I'd forgotten about it, silly me. Thanks! I think I
can get that to work easily enough even without examples.
Regarding using multiple lines, that would be the ideal solution (it seems you
could do even better by having four lines for each object, one for each
corner),
On 2/20/2012 1:50 PM, Julian Marchant wrote:
Hi, I tried searching the internet for an answer, but didn't find anything,
so I'll ask here.
One problem with normal collision detection I'm sure we're all aware of is
the problem that objects moving too fast can pass through other objects
Hi, I tried searching the internet for an answer, but didn't find anything, so
I'll ask here.
One problem with normal collision detection I'm sure we're all aware of is the
problem that objects moving too fast can pass through other objects without a
collision happening. I'm experiencing this
Just a quick idea off the top of my head. What if you just get a rect
covering from the bullets previous position to the bullets new position?
Quick psuedo-code:
xpos = min(old.left, new.left)
xpos2 = max(old.right, new.right)
width = pos2 - pos
#Do the same for y/height
Rect(xpos, ypos, width,
On Mon, Feb 20, 2012 at 3:58 PM, Sam Bull sam.hack...@sent.com wrote:
Just a quick idea off the top of my head. What if you just get a rect
covering from the bullets previous position to the bullets new position?
What about the diagonal motion?
I'd recommend something similar, though. Just
You could use the point of intersection between two lines.
One line is the bullet trajectory.
The other line is the target trajectory.
You have to take into account the time of the intersection too.
If the intersection falls inside the target at the right time for both
projectile and target
Or if you like spoilers maybe somebuddy has some Python code you can rip,
like this guy:
http://code.google.com/p/gummworld2/source/browse/branches/tiled2/gamelib/gummworld2/geometry.py
Specifically, functions line_intersects_line and point_in_poly.
Gumm
On Mon, Feb 20, 2012 at 3:33 PM,