Hi all
I am working on a 2d RPG game in java.
my game objects are stored inside HashMap<String, objectType>
so my tiles for example are store inside Hashmap<String, Tile>
The String is a unique code for each tile. whenever i want to use certain tile for example: "GR"
CODE
TileDatabase.get("GR");
now, my tilemap should contain 2 layers of tiles.
first layer is the background: grass,rocks,water.
second layer is trees, table, etc.
my problem is how to create that TileMap object.
what i tried is creating a database for 1 layer tilemap.
then when creating the double layer tilemap, i took as parameters two 1 layer tile map objects from the tile map databse and constructed a new map out of them.
but it seems a mess. even when i try to explain it is a mess.
so my question is which parameters i should assign to my map and how, considering the way my data is stored.
I really dont ask for code, but for ideas and what's behind it.
thanks!