Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Help! My Tile Scrolling Is Disfunctional !?!

This topic is 6192 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

Hey, Here is the code that I use to define the xpos[] and ypos[] for the tiles just before drawing them... void DrawMap(void) { int startx = camerax; int starty = cameray; int endx = camerax + 640; int endy = cameray + 480; xpos[0] = startx; ypos[0] = starty; for (int i = 1; i < 300; i++) { currentFrame[i] = 0; xpos[i] = xpos[i - 1] + 32; ypos[i] = ypos_identifer; if (xpos[i] >= endx) { xpos[i] = startx; ypos_identifer += 32; } } // draw tree, tree frame = 1 for (i = 0; i < 300; i++) { if ((xpos[i] == 192) && (ypos[i] == 192)) currentFrame[i] = 1; } ypos_identifer = 0; } and to scroll I just have camerax or cameray += 4, however when I do this and call the DrawMap() function again the game crashes! Does anyone know why? Also is there a better way to do what the above code does? Please help! Thanks... Edited by - webmunkey on August 3, 2001 10:30:02 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!