void drawTileMap(int[][] map, int tileW, int tileH, int offsetX, int offsetY) int startCol = offsetX / tileW; int startRow = offsetY / tileH; int endCol = startCol + (640 / tileW) + 1; int endRow = startRow + (360 / tileH) + 1; for(int row = startRow; row < endRow && row < mapHeight; row++) for(int col = startCol; col < endCol && col < mapWidth; col++) int tileId = map[row][col]; int x = col * tileW - offsetX; int y = row * tileH - offsetY; g.drawRegion(tileSheet, tileId*tileW, 0, tileW, tileH, 0, x, y, 0);
Many 640x360 games were designed for early resistive screens; modern emulators must translate these "clicks" into capacitive multi-touch gestures. Heaps/Memory: java games 640x360 portable