Hey there.. first time posting... old timer at gamedev, but always found the answers I needed.. anyway...
I am curious about one thing.. I am making a game... 2d sidescrolling.. and I want to know how to get the floor coordinates for collision between character and floor... but lets not consider tiles (at least at first)... I mean, a really irregular floor...
Do I have to keep record of every Y coordinate of the floor, for every X on the cenario? Like, store it in some data structure?
How is that testing done usually?
Let me know if I have not made myself clear...
thanks for the attention.
2D sidescrolling floor
Quote:Original post by kfboelter
Do I have to keep record of every Y coordinate of the floor, for every X on the cenario? Like, store it in some data structure?
One optimization you could implement would be to store a series of straight lines that trace the surface of your floor. Then when you do collision, you would check all the lines within distance of your colliding object(s) and perform corrections that way.
What data are you using to generate these maps? In order to test for collisions you have to have the height stored somehow. You should be able to use whatever data is in there to get that height data. Its the same for tile based games (which is mearly an optimization by forcing a form of spacial tree). Are we talking like "Scorch the Earth" type maps here (with really rough pixel based heights?).
Thanks for the answer guys^^
Actually, we are not talking about specific types of cenarios per say... is more like... kynds of techniques that we can use... such as the 'fore mentioned straight lines and stuff :D Sonic/Super Mario stuff...
If anyone else has some other sort of ideas, pls, share...
thank you all...
Actually, we are not talking about specific types of cenarios per say... is more like... kynds of techniques that we can use... such as the 'fore mentioned straight lines and stuff :D Sonic/Super Mario stuff...
If anyone else has some other sort of ideas, pls, share...
thank you all...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement