This is a small tech demo of a shoot 'em up (shmup). I made this mainly to extend my framework so that I can make shmups easily. It doesn't have a lot of content, because I just needed one example of each thing I was trying to do. This is my May entry for One Game A Month.
Here are some of the things I added to my framework over the last couple of weeks to support this:
TMX parser and compiler
I wanted to make a scrolling background out of Daniel Cook's Hard Vacuum tiles, so I made a map in tiled which creates a TMX file. This is an XML file that is easy to parse at runtime in Actionscript. In debug mode, the parser loads the tile images at runtime, but in release mode they need to be embedded in the SWF at compile time. To solve this problem, I wrote a program in Ruby that compiles a TMX file to Actionscript. This way, there is no parsing or need for external files in release mode, but in debug mode I can change the tile map without recompiling.
I knew that I would want a wide variety of enemy behaviors, but my traditional method of handling AI with state machines was getting unwieldy. I recently read about a better way to handle it called behavior systems. This is sort of like a simplified, formalized neural network. Each entity's behavior is represented by a tree of basic building blocks. One block might choose between its children, one block might fire bullets, and one block might move the unit. Each node might cause side effects as signals are communicated through the tree. This conceptually shares a lot with behavior networks in functional reactive programming.
My implementation of the behavior system is still rough, but I think I like how I've integrated it with my component-entity framework. I need to work with it more to figure out a good set of basic blocks so I don't have to build a custom block for every behavior that I want. I also want to be able to create the behavior trees declaratively. At this point I can generate a tree from a single Object that is mostly declarative, so I'm close to generating it all from XML. I have to figure out how to inject variables.
This was fairly simple. I have three bitmaps that move down the screen. When one goes off the bottom of the screen, I draw the next set of tiles into it and move it back to the top. Doing it this way, I get (simple) destructive terrain for free. For example, tanks could leave tread tracks, or explosions could leave craters. To keep things simpler, I made the bitmaps entities that are children of a single entity, so they can all move at once. The tanks are also children of the map entity so they move along with it.
I created the enemy sprites in Blender. I'm getting better at modelling in Blender, but this was the first time I tried to export sprites. It was hard to figure out, but I think I have the process down now. It's a pretty easy way to make sprites of rotating objects that could be useful to other people, so I'll try to make a tutorial about it.
There is a lot left out of this, because this was just a project to get the bare bones running. Here are some things that are missing:
I didn't make any bosses, because they will just use the same systems the existing enemies use. They'll require more art assets, and more complicated behaviors, but the framework is all there.
I made powerups in Spin, so I pretty much have that down. Adding the results of the powerups will be interesting. Different shot patterns, drones, bombs, etc. Those will be interesting new features.
The enemies don't react when you hit them until they explode. I need to add signal paths to the behavior system, so I can signal to an entity's behavior tree that it's been hit.
Levels, patterns, fun
Yeah, I know. Next time.