Original Post
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