• Advertisement

Archived

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

Tile engine question

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