disclaimer: the only coding I've done so far, is in school dealing with output in a command line :-p
I'm figuring out this opengl one step at a time. right now I'm trying to figure out how to handle 'collisions' with objects.
I have a class of 'rectangle' that keeps track of the coordinates of the corners of a rectangle,
and i have a ball, which is really more of an octagon made of 3 rectangles like so:
and then i have blocks that have just one rectangle on top of them.
what i need is the ball to move fairly fast (like 3-5 units/draw) and then stop when it comes in contact with a rectangle.
so, if i check for intersection the ball will sometimes go into the block and then suddenly pop back out of the block, which doesn't look right.
my idea is that i will have a collision function that always looks 3-5(depending on what speed i go with) units ahead to check for a future collision. but if the ball is traveling 5units/draw and it sees a block 2 units away should i just move the ball 2 more units?
again, this is the first time I've had to make a game, I'm just trying to nail down the design here. thanks in advance for any help.