It's a simplistic question, i've created my own engine for now that handles windows API and i have my own structs for sprites etc.., and to keep this in the rules.., I'll be implementing gdk.. later >.>.
Anyway my question is in a 2D engine, how would you go about making a scrolling world?
here's a list of what i think may work but haven't tested:
a.)
make tiles everywhere in the screen, then every time the player moves, the tiles move left for example then once they've reached over the screen position them to the other side, and apply the next in line texture.
b.)
Setup the entire level to draw ALL sprites off that piece of level, then only draw what's within screen borders. Then when the player moves it's simply positioning the level at it's current position +/- players movement
Perhaps b may be the best bet?
Next collision, i know it's simple enough to do box collision, but saying a simple oldx#=x# and oldy#=y# wouldn't do this time as they'd stop dead on the spot if they hit ANY box. My solution may be to create a function to check each side of the box to see where the collision has happened up /down / left/ right. Or can you guys think of a better way?
Last but not least, any other help or suggestions are welcomed. I've been doing c++ for a year now, so i should be able to handle most things, I'm just a bit un-experienced when it comes to how to handle a 2D engine. Surprising since i know if it was in 3D i'd simply just make the level and move the camera. (And no i do not wish to do this game in 3D)
Oh yea.. and jump code, I'm guessing to use a sin wave, to make it look fluent?