This project is read-only.

Mini game tutorial

Jul 10, 2009 at 2:01 PM

I would definitivelly appreciate a mini game tutorial that would include all the subsets of how a game is structured using Xen.

I have serious difficulties to understand how to properly set up my software class design to work on larger developments than the provided tutorials.

Do you think you could get up with something? ;)



Jul 16, 2009 at 1:44 PM

Hi Philippe. I'm really sorry I missed your question, I somehow missed the email notification and I've been crazy busy recently (trying my best to get a new job sorted out).

I'm probably going to disappoint you in my answer, but there isn't really a magic formula that works for all games. I've tried to provide the lowest level stuff (which is usually fairly universal) but once you start getting to higher level game structure, well, things get really complex and vary a lot. Generally it takes a lot of trial and error to find something that works for the specific type of game you are trying to create (as I guess you are finding out).

I've tried to provide the basics. Ie, a start point for drawing (DrawTarget) and an update method.  Really, you can do whatever you want from there. You don't need to use IUpdate/UpdateManager, you don't need to use IDraw even (with the exception of the very first draw code to be called). It's all optional.

The only thing I can really suggest is to look at the official XNA tutorials. These provide extensive examples on one way to do things (the GameComponent method, where there is a global register of objects that are drawn/updated). You could easily implement something similar with a couple of List<>'s for example. But that doesn't mean it's a good design for all games. Frankly, I don't actually like it that much because I feel it's a poor fit for many styles of game.

I will be providing a small example that demonstrates very basic game state management (really basic!) in the form of a 'press button to start' style of thing. However even this has numerous ways to be implemented, and the way I've done it has it's drawbacks, just like every method.

I'm sorry I couldn't be more help but what you are asking is actually a tremendously hard thing to provide. Also I worry because It's a fine line between helping people by pointing them in the right direction and making them think 'ohh, this is the only way to do it'.

Jul 17, 2009 at 12:37 AM

Hi StatusUnknown,

That's fine really no need to be sorry ;) I know what it is to be busy.

My request for a small game example was more for a best practice sample. I've been using my own implementation of the GameComponent system but I knew exactly when and how my draw and updates were done while with Xen, I tend to have difficulties to see how it works ;)

Maybe I should have asked more for a diagram of a standard Xen application run path and how and when the respective core classes are called?