Jump to content
  • Advertisement

Archived

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

knine

Tile engine question

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

I''ve got smooth scrolling going on in a simple tile engine. But how can i make it stop scrolling when it reaches the end of a map? the map is just a 2 dimensional array. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You could use your xTile && yTile coordinates for bounds checking, like so.


      
if ((xTile >= xMin) && (xTile <= xMax))
{
/*Move character on x-axis*/
}



  
if ((yTile >= yMin) && (yTile <= yMax))
{
/*Move character on y-axis*/
}




[edited by - masterg on June 29, 2002 3:01:49 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!