[font=lucida sans unicode,lucida grande,sans-serif]Thanks everyone![/font]
[quote name='Servant of the Lord' timestamp='1335814985' post='4936161']
How does collision detection work with non-cube 3D models in a complex world in a 3D game? They don't bother checking collision for every little triangle that makes up the 3D model, until such precious is needed. For 2D images, you don't bother checking per-pixel collision until you need such precision. You can check a generic axis-aligned rect first and only if it passes that rect, then you check per-pixel or per-triangle ([i]if[/i] you need it).
That's understandable, I read something the other day about how some collision handling is used with the bisection method, until they really need per-pixel precision. Also the editor looks nice, I had been messing around with Tiled before thinking about this and (quite obviously) it was tile based.
[quote name='BeerNutts' timestamp='1335821307' post='4936185']
Basically, you'd assign some geometric shape to objects in your game, and use a 2d physics engine to handle all the collisions. So, some objects might be a circle, line, rectangle, or other complex polygon.[/quote]
[quote name='lmbarns' timestamp='1335803337' post='4936122']
That snuggle truck game looks like the curves are pretty straight other than the joints.
So when you come down to it all the objects are just made up of bounding boxes (or spheres)? That makes sense.
I [i]think[/i] I have a decent grasp on how I would achieve this, however on the subject of collision I have a rather silly question: which is how do I tell which side of the object my player has collided with. Even with tiles. What I am doing is checking to see if player.x is within the x boundaries of the object, and the same for y. However I am not too sure on how to tell whether my player is colliding from the top or the left for example, so I don't know which velocity, dx or dy, to stop.
So some pseudocode:
# With each object being a tile.
If player.x > object.left && player.x < object.right
&& player.y > object.top && player.y < object.bottom then
dx, dy = 0, 0
I do feel silly for asking this but I guess it's the beginners forum so here I gooooo!