PDA

View Full Version : "Collision " for platforms.



syrozudo
01-22-2016, 04:45 PM
Hello.
I'm a begginer at openGl, and I created a simple game, where you have to jump on some platforms.
Now Im writtingg, the "collision "

I made it like this :
I got a function that is like Grawity. Its all the time sumstracting a constant number from my y ( height ).

There is an other function, them can stop this Grawity function.
It comparsing the actual position of the player, with he platform. It compars the x,y,z coordinates.

Also, the problem is, that I moved this all platforms into a vector, and now I wanna that this function, compare all the time, all platforms, with my coordinates.
The point is, for one platform it works perfect, but how to do it, for many platforms? Tryyed to use some if's but I dont work, when I put it into my OnRender function..
Sorry for my bad english skills. Would be great, if someone can push me in the right way, to solve it!
Cheers : )