SDL help

How i can make bigger the map in SDL?
I mean how i can put obstacles in the screen that is not showed,and while player is moving ,the map going more left.etc//....

I know how to do it in the background,but how i can do it in the map,and how i can put obstacles there?
You should think of the map and the screens as different things.

The map is the thing where the obstacles and the player resides and their coordinates tells you where they are located on the map.

The screen is what the user can see. To move the screen around the map you need to keep track of the coordinates of the screen. It might be possible to calculate the screen coordinates from the player coordinates but that depends on your game. The drawing code has to be changed so that it draws what's inside the screen at the correct position.

If the map is very large you might have to come up with ways to optimize things so that you don't have to loop through all obstacles when doing collision detection and drawing them, etc.
Last edited on
Man you know good sdl.
Could add me in skype:


(if yu have not,you can make one,it is fast and usefull)
Topic archived. No new replies allowed.