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?
Just a quick question
Moderator: Coders of Rage
-
- Chaos Rift Newbie
- Posts: 30
- Joined: Sat Apr 18, 2009 8:17 pm
Just a quick question
Thanks to gyro vorbis for inspiring me to learn how to make a 2d graphics engine
Re: Just a quick question
Depends on what you want to do with that "tile engine", but that should work in most cases.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?
-
- Chaos Rift Newbie
- Posts: 3
- Joined: Sun Apr 26, 2009 12:44 pm
Re: Just a quick question
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.
-
- Chaos Rift Newbie
- Posts: 30
- Joined: Sat Apr 18, 2009 8:17 pm
Re: Just a quick question
I used to work with xna too. I havnt really noticed such a speed difference between xna and sdl
Thanks to gyro vorbis for inspiring me to learn how to make a 2d graphics engine