Shmup Development (using XNA and C#)

Tuesday, October 17, 2006

Rewritten and redesigned

The last weeks I have rewritten the whole thing, well not the WHOLE thing, but a lot. Of course I have copied much of the old design and code. I'm much more happy with the code now, It's a lot cleaner and the whole idea is based around "Behaviors".

A "Behavior" is a baseclass that all other behaviors inherit from. A behavior can describe how your ship is controlled, how the enemies fly and attack, how an powerup works and so on. I really like this system because it introduce so much freedom with the design. For example I could write a behavior that describes how a enemy should explode (sprites, particles, shockwaves...). If I'm happy with this explosion I could then apply it to my player ship as well very easy. All entities inherit from "Entity" which has a "Behaviors" property, this is a list so I can add how many behaviors I want. It's like baking a cake and have the flexibility to add any ingredients you want...

I have also created a configuration system which is very flexible. It simply is an xml file which can include a whole level (with enemy paths, graphics, behaviors...). If I decide to create a new behavior (let's say a new enemy bullet pattern) I can add this in the xml file and then tell the system how this behavior should be created from the xml node.

I think I have come up with a system that is flexible, and I kind of like that. I think the most used word in this post is "flexible"!

0 Comments:

Post a Comment

<< Home