Thanks

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuFOR y = 0 TO tilesDown +1
FOR x = 0 TO tilesAcross +1
IF map[x][y][1].tile <> 0
DRAWSPRITE map[x + tileAddX][y + tileAddY][1].tile, (x*tileSize) + ScrollAmountX, (y*tileSize) + ScrollAmountY
ENDIF
NEXT
NEXT
Quote from: bigsofty on 2011-May-29
I don't think it has anything to do with blank tiles, the vars ScrollAmountX and ScrollAmountY are being continuously reset to -48. This may be the cause of your jerking.
//MAIN GAME LOOP
WHILE KEY(01) = FALSE
//Draw Tile Map
FOR y = 0 TO tilesDown +1
FOR x = 0 TO tilesAcross +1
IF map[x][y][1].tile <> 0
DRAWSPRITE map[x + tileAddX][y + tileAddY][1].tile, (x*tileSize) + ScrollAmountX, (y*tileSize) + ScrollAmountY
ENDIF
NEXT
NEXT
//Go Right
IF KEY(32) OR KEY(205)
ScrollAmountX = ScrollAmountX - 2
IF ScrollAmountX < tileSize - (tileSize * 2)
ScrollAmountX = 0
tileAddX = tileAddX + 1
ENDIF
ENDIF
//Go Left
IF KEY(30) OR KEY(203)
IF tileAddX > 0
ScrollAmountX = ScrollAmountX + 2
ENDIF
ENDIF
IF ScrollAmountX > 0
ScrollAmountX = -48
IF tileAddX > 0
tileAddX = tileAddX - 1
ENDIF
ENDIF
//Go Up
IF KEY(31) OR KEY(208)
ScrollAmountY = ScrollAmountY - 2
IF ScrollAmountY < tileSize - (tileSize * 2)
ScrollAmountY = 0
tileAddY = tileAddY + 1
ENDIF
ENDIF
//Go Down
IF KEY(17) OR KEY(200)
IF tileAddY > 0
ScrollAmountY = ScrollAmountY + 2
ENDIF
ENDIF
IF ScrollAmountY > 0
ScrollAmountY = -48
IF tileAddY > 0
tileAddY = tileAddY - 1
ENDIF
ENDIF
SHOWSCREEN
WEND