A few days ago I posted here a video of my horrible first game - a generic space shooter.
[media]http://www.youtube.com/watch?v=8nO-B3_yiY0[/media]
That game worked this way:
-I had a Sprite class with two methods: Draw and Update.
-I had three classes: Player, Enemy and Projectile. All of them inherited from the Sprite class. They had an Update method which overrided Sprite's Update method.
-In Game1 I had a List<Sprite> called "elements". Every Player, Enemy and Projectile objects were initialized in that list.
-In Game1, in the Update method, all the Sprites in elements would call their own Update method. Same thing for the Draw method.
...
Ok, that's a pretty bad implementation for any kind of game, but it worked.
For my next project, I would like to create a Sokoban ([url]http://en.wikipedia.org/wiki/Sokoban[/url]) clone.
This project requires a very simple tile-based engine.
Now - the main problem is: where do I start?
Should I still have a Sprite class? Should the Tile class inherit from the Sprite class?
Or should I go a step forward and use GameComponents (I don't really understand how they work yet).
Should I keep using a list in Game1?
I need some help to understand how I should plan my game before starting to develop.
I'm no expert but you seem to have the general idea.
If all your Sprite class has is Draw and Update then you might want to look at using the IUpdateable and IDrawable interfaces instead. (in your Sprite class, not in place of it)
[quote]Should I keep using a list in Game1?[/quote]
I'm unfamiliar with tile systems but you'll probably want to write some sort of manager class for the tiles. This is the "facade" pattern I think, if you want to look it up.
[QUOTE=Ortzinator;16704584]I'm no expert but you seem to have the general idea.
If all your Sprite class has is Draw and Update then you might want to look at using the IUpdateable and IDrawable interfaces instead. (in your Sprite class, not in place of it)
I'm unfamiliar with tile systems but you'll probably want to write some sort of manager class for the tiles. This is the "facade" pattern I think, if you want to look it up.[/QUOTE]
Thanks, the facade pattern is a good idea, I will try it.
Sorry, you need to Log In to post a reply to this thread.