In theory, how do I handle a landscape that is curved, in my sidescrollers? Or if I have spikes or the like?
Usually I do something with boxes, and they’re easy to check… So, how are curved landscapes stored, drawn, and collision checked/handled? :cranky:
One possible attempt would probably make your program draw a bunch of small lines for it. Then just do a simple slope intercept or point slope calculation.
How is your level drawn? or the map data itself saved? Is it 1 big bitmap(image) or is it tiled?
However, depending upon how big the level itself, you could just check against every point/pixel, below your character. You don’t have to compare it against the whole level, just directly below your current yPos
edit: I have also seen that on games with curved surfaces and irregular terrain, there is typically a separate file/data/image that it used in collision detection. So that if you have your main map have a hill with grass and other debris on it, you have a secondary one with a clean round hill.
edit 2:
Although its a bit complicated/advanced at first.
http://www.metanetsoftware.com/technique/tutorialA.html
Has a great bit of fast collision detection in non traditional “square maps/objects” while still using a tile based map system.