Scrolling

Started by
4 comments, last by _the_phantom_ 18 years, 11 months ago
Anyone know of a tutorial about 2D sidle-scrolling in OpenGL? Basiclly I have a large map and want to move the character in any direction.
Advertisement
just use gluLookAt() and translate it along the side of your map whenever a key is pressed.

gluLookAt is a VERY easy function to use.
gluLookAt(camPositionX, camPositionY, camPositionZ,          targetX, targetY, targetZ,          0, 1, 0);  //this is the "up" vector. it tells the camera which direction is up
Hmmm.... but what if I can't determine how man keypresses are enough to move the main character/object? Also, not pressing anything might still mean you are moving (gravity).
Ok, since no one knows of any tutorials can someone answer this question: I wan't to have large map files which will be bitmaps, should I split the map into sections and load each section when I need it or should I just load the whole thing?
i know of no tutorial since im not interested in that field
perhaps look at www.libsdl.org theres plenty of games there (with sourcecode) many use opengl
Quote:Original post by subflood
Hmmm.... but what if I can't determine how man keypresses are enough to move the main character/object? Also, not pressing anything might still mean you are moving (gravity).


Movement shouldnt be a direct result of input, input should just be a parameter into a movement function which handles interactions with things like gravity and other collisions.


as for the map, make it title based if you can that way you wont need to store the whole level as one bitmap but just the tiles and then you put them in the right places when drawing

This topic is closed to new replies.

Advertisement