Page 1 of 1

Just a quick question

Posted: Thu Apr 23, 2009 11:14 pm
by deathsangel
Can you guys tell me if this is a good approach for making a tile engine?

I created a layer class which loads the file, and turns it into a layer.
Then I have a map class which stores layers.
Finally in my draw code I call map.draw() which loops through all the layers in that map and draws them.

So can you guys please tell me if this is a good approach, and if it is not please tell me what I should do instead?

Re: Just a quick question

Posted: Fri Apr 24, 2009 6:22 am
by K-Bal
deathsangel wrote:Can you guys tell me if this is a good approach for making a tile engine?

I created a layer class which loads the file, and turns it into a layer.
Then I have a map class which stores layers.
Finally in my draw code I call map.draw() which loops through all the layers in that map and draws them.

So can you guys please tell me if this is a good approach, and if it is not please tell me what I should do instead?
Depends on what you want to do with that "tile engine", but that should work in most cases.

Re: Just a quick question

Posted: Mon Apr 27, 2009 3:51 pm
by SuperSmashcz
When i used to work in XNA (OMG!) I had done the exact same thing. I created a layer class which held data for a specific layer, then a tile class which held multiple layers so i could put on top of another. Then a map class which had an array of tiles representing the map. It was just a nice way to break up the parts and organize it. They way your doing it should be fine. Just try to be cautious of performance if you have too much stuff going on at once.

Re: Just a quick question

Posted: Sun May 03, 2009 11:58 am
by deathsangel
I used to work with xna too. I havnt really noticed such a speed difference between xna and sdl