Jump to content
  • Advertisement


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


Tile Map Scrolling

This topic is 5807 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 everyone, two questions.One, is the directx 9 sdk out?and the main question is this. I am making a tile engine(for an RPG)i have the tile map load from a char structure, and it draws the maps etc(Im using DX 8 btw) anyways, everything is set up, i just need a way to add scrolling. Is scrolling just modifying the x,y coordinates of the tiles?Like if they press left, every tile''s x coordiantes is subtracted by 32?(Tile size)thx

Share this post

Link to post
Share on other sites
it depends on how you want to do it. There is a very simple smooth scroller on my site you can look at. Nevermind that it is using my own API you should get the general idea by looking at the source.



Try RealityRift at www.planetrift.com

[edited by - MichaelT on January 18, 2003 5:01:28 AM]

Share this post

Link to post
Share on other sites
You must calcuate the screen coordinates for every object, like this :
object.screen_x = object.global_x - (player.global_x - player.screen_x)

In this case this holds true : if( key_left() ) player.x--;

For example:

player.global_x= 50
player.screen_x= 5

//player.screen_x is a default value, the amount of space before the player :



//0-4 => p.s_x=5

object.global_x= 53
object.screen_x= 53 - (50 - 5) = 8

[edited by - viajero on January 18, 2003 5:37:34 AM]

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.

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!