Man wasted my time dickin around with this for a whole day.....
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| switch(blockDescriptor) { case "white": g.setColor(GameRender.white); break; case "brown": g.setColor(GameRender.brown); break; case "grass": g.setColor(GameRender.yellowGreen); break; case "denseGrass": g.setColor(GameRender.grassGreen); break; } |
Duh x 2 My playerX and Y along with the buffers are divided by tileSize already, so I needed to use the moveX and Y that I showed earlier. I guess I just needed some sleep lol.
1 2 3 4 5 6 7 8 9 10 11
| int moveX = 0, moveY = 0; for(int y = PlayerChar.playerY - GameMain.yBuff; y < PlayerChar.playerY + GameMain.yBuff; y++) { for(int x = PlayerChar.playerX - GameMain.xBuff; x < PlayerChar.playerX + GameMain.xBuff; x++) { block[x][y].render(g, moveX, moveY); moveX += tileSize; } moveX = 0; moveY += tileSize; } |
Now to fix all my tiles for the old engine to work with the new one.