Skip to main content
GameDev.net gamedev.net
🔒 Locked

Some Iso problems

Started by yogr Feb 16, 2007 at 9:02 AM 0 replies 850+ views
Original Post
yogr
yogr
Hi, i'm developing an isometric game, but I have some problems with the movement of the viewport. My map is stored in an array like this: map[layers][mapWidth][mapHeight] where mapWidth and mapHeight are the size of the map as number of tiles I have a character placed in the cell pX and pY and a viewport located in vX and vY. When i draw the map i start frome te vX and vY cell printing horizontal lines of tiles. I also have isoDeltaX and isoDeltaY to shift the tiles when i Scroll the viewport. I can scroll the viewport smoothly along horizontal and vertical axis (I'm talking about square screen not diamond), but when i try to scroll along the axis of the tiles the scrolling is sometimes choppy. when i catch the UP key, for example, i change the isometric delta variables like this:
isoDeltaY--;
isoDeltaX+=tileWidth/tileHeight;

and if (  isoDeltaX >= ((tileHeight/2+isoDeltaY) * 2)  ) {
  isoDeltaY = (tileHeight/2+isoDeltaY);
  isoDeltaX = (-isoDeltaX + (isoDeltaX-tileWidth/4));
  vY--;
}
Thanks
yogr
yogr
Solved, I was setting the isoDeltaX in the wrong way.
Bye.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.