Hello everyone. It is some time since my last post so i’ve learned some things. Currently i am in a big mist.
Usually, when i want to create a tile map i do so:
- I create a int[][] with every tile’s index
- Using every tile’s index, i put a tile object in an ArrayList so:
ArrayList<Tile> tiles = new ArrayList<Tile>();
for(...every tile in int[][]...) {
switch(int[x][y]) {
case GrassTile.id: tiles.add(new GrassTile(x, y));
case ...
...
...
}
}
Is my aproach right? If not, how should i do this…
Thank you!
EDIT: And also, can anyone sugest me how should i design the tile classes so that when i want to add a new type of tile, i should not change too much in the other classes?