2008-03-02

The Secret Posts - More Progress

(Written 03/02/2008)

Another extensive set of additions. The “UFO” class now exists, and I’ve added in the animation frames. It looks a lot more convincing than I’d hoped. I’ve added the tilt bitmaps to the chopper. Apart from the tilt backwards frame, which doesn’t look right, the others work perfectly.

As I was getting the tilt frames working I realised that the BitmapListRenderEngine wasn’t going to work, and was a waste of memory considering the fact that the BitmapServer did basically the same thing. I replaced it with a “BitmapRenderEngine” class that just holds a pointer to a single SDL surface, which is far easier to use. Both the BitmapRenderEngine and AnimationRenderEngine now clip to the playfield’s dimensions.

It was about time to see if the CannonEngine system would work, so I created a “ChopperBasicBullet” class that holds the round grey bullet. In addition to this, I’ve added a “PlayerCannonEngine” class that watches the fire buttons and creates bullets accordingly, and I’ve added a “PlayerBulletManager” class that lives in the Game class and takes care of the bullet once it has been fired. The bullet is propelled by a “BasicMovementClass” that uses velocity and acceleration variables to propel a sprite.

That worked well and was easy to put together, so I created a “RadialCannonEngine” that fires “EnemyBasicBullet” bullets in a circular pattern and injected it into the UFO class. The MathTools class provides the lookup-based trig functions necessary to get it all working. Instant radial bullets.

The Rocket now moves down the screen in a straight line. It is powered by the same BasicMovementClass that propells the bullets. It’s followed down the screen by a smoke trail provided by the ParticleManager.