Jump to content
  • Advertisement
Sign in to follow this  
subflood

OpenGL Scrolling

This topic is 4958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!