Tile Map Scrolling

Started by
1 comment, last by tenchimusakiryoko 21 years, 2 months ago
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
"Good,evil,I got the gun"Ash- Evil Dead
Advertisement
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.

regards

MichaelT

____________________________________________________________
Try RealityRift at www.planetrift.com

[edited by - MichaelT on January 18, 2003 5:01:28 AM]
No no no no! :)
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= 50player.screen_x= 5//player.screen_x is a default value, the amount of space before the player ://-----P--O--//0123456789A//0-4 => p.s_x=5object.global_x= 53object.screen_x= 53 - (50 - 5) = 8  


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

This topic is closed to new replies.

Advertisement