Well, its not always easy to find when searching. I'm even having trouble ^^
Are you using any sort of library, like Slick2D, libgdx or something?
I did this a while ago, and I ended up making a Tile-class. Each tile would have an ID, a "passable"-boolean, and a few other pieces of information. Then my maps would have an int[][] of the IDs, and I'd run through it drawing each tile separately.
1 2 3 4 5 6 7
| int tileWidth = 40, tileHeight = 40; for( int i=0; i < currentMap.getHeight(); i++){ for (int j = 0; j < currentMap.getWidth(); j++) { int ID = map.getTiles[i][j]; g.drawImage(tileImages.get(ID), j*tileWidth, i*tileHeight, null); } } |
Then you can make adjustments depending on where the movements of the player.