I’ve made some more progress on my game engine since last time. I’ve been concentrating on the sprite subsystem, making it so I can have things moving around the screen. All of this is being controlled by the XML file, so most of the coding has been quite generic; creating “manager” classes and storing things in lists. And parsing XML… lots of XML parsing. It’s the type of coding you can spend hours on, but have little to show except a bunch of classes and a single sprite on the screen that does nothing at all.
Well in the spirit of learning something new, I decided it’d be good if my games could have sprites that followed patterns on the screen. This could be used in shooter games, or as the beginning of an AI in some sort of top-down car racing game. This post on the Shmup-Dev forum introduced me to Catmull-Rom splines, and after a few hours I had little test sprites making their way around the screen. With a bit of modification, I then made it so that I could have “chains” of sprites chasing each other around the screen, all glued to the same path.
So now I can have enemies enter the screen, fly around a bit and then disappear off the screen again.
I need to think up some way of timing the appearance of entities on the screen. Currently I use a frame counter, but it’s a bit of a hack at the moment.
I recorded a video that demonstrates it a bit better. http://www.vimeo.com/8015369

