isometric map

Started by
1 comment, last by fredjordans 22 years, 1 month ago
I have code that will draw an isometric map on screen. However, I need to work out some logic behind the map so that I can do scrolling, keep track of the player''s world position, etc. It''s so much easier with a topdown tile-based map, because the x and y coordinates are much easier to keep track of. thnx
-eat me!-but i''m not a cannibal!
Advertisement
You need WorldTile X+Y components for the scrolling part.

Set WorldTileX = 0 and WorldTileY = 0
for y = WorldTileY to WorldTileY + numTilesAcrossScreen
for x = WorldTileX to WorldTileX + numTilesDownScreen
PlaceTile(WorldTileX, WorldTileY)

Then to scroll, you update WorldTileX and WorldTileY by whatever amount. You have to do some checking to see that you are not running past the ends of your map. Think it through a bit and get out a piece of paper and plot some out.

For the player he needs WorldTile variables as well.

There are also pixel by pixel scrolling algorithms probably on the GameDev Articles & Resources. There's also the Isometric Forum on GameDev run by TANSTAAFL who written an iso book.


ZoomBoy
Developing a iso-tile 2D RPG with skills, weapons, and adventure. See my old Hex-Tile RPG GAME, character editor, diary, 3D Art resources at Check out my web-site

[edited by - ZoomBoy on March 21, 2002 7:20:34 PM]
I''m having a strange problem..I created a map, set its dimensions, and drew it on screen using the method described above. I am able to get scrolling to work. However, when I scroll around the map, the dimensions seem to be the dimensions I set, PLUS the dimensions of the screen.

So, if I have a map 50*40, but I only draw 10*10, then the dimensions seem to be 60*40.

I''ve been fooling around with this for so long, and I''m still having problem. Another reason I''m having troubles is because the map description is stored in a 1 dimensional integer array, so it''s hard to pullout the appropriate information for a certain tile.
-eat me!-but i''m not a cannibal!

This topic is closed to new replies.

Advertisement