Original Post
I would consider myself a beginner programmer so I need help on how I should structure my tile based game. The game is a 2D Minecraft or Terraria type clone I'm developing for learning purposes.
I'm more concerned about how I'm going to make each tile. Should I have base class called "Tile" then have tiles like dirt, stone, wood derive from it? Then I could have a 2D array of "Tile" to be the world. A problem I see with that is there would be a lot of instances of the same type, I'm talking thousands because the worlds are going to be huge. Or should I just have one class called "World" and inside that have a 2D byte array where each byte represents a different tile. A problem with this however is I'll need to loop through each byte every time I wan't to do something like say check if the tile is collidable or not.
Could I receive some help on this?
Thanks.
I'm more concerned about how I'm going to make each tile. Should I have base class called "Tile" then have tiles like dirt, stone, wood derive from it? Then I could have a 2D array of "Tile" to be the world. A problem I see with that is there would be a lot of instances of the same type, I'm talking thousands because the worlds are going to be huge. Or should I just have one class called "World" and inside that have a 2D byte array where each byte represents a different tile. A problem with this however is I'll need to loop through each byte every time I wan't to do something like say check if the tile is collidable or not.
Could I receive some help on this?
Thanks.