Developing a game for the Motorola Q

Just before I went on vacation, I picked up the Motorola Q, which runs Windows Mobile 5 Smartphone. Microsoft is working with Verizon Mobile to offer a pretty hefty employee discount, both on the hardware as well as the service plans.

I downloaded the 900MB Windows Mobile 5.0 Developer Resource Kit, the Windows Mobile 5.0 SDK for Smartphones (possibly not necessary), ActiveSync 4.2, the Motorola Q Developer Guide, and the Emulator Image for the Q (makes the smartphone emulator look just like a Q).

The first thing I did, of course, was try my hand at writing a game. I threw together something on my first day in Oregon, loosely based on geometry wars and implemented using GDI. A square is moved around on the screen, chased by circles that must be shot down.

I implemented it with techniques from a Design Patterns course I took earlier in the month. Shape objects have behavior objects (Decorator pattern) that can modify the owner (such as a Sin/Cos behavior, which alters the parent's course in an elliptical pattern, or a MoveToShip pattern that moves the shape towards the ship). The Shape object itself is an abstract class, with a GDI-specific implementation (Strategy pattern). Factories and adapters, oh my! 

A testament to patterns
Later that week I got around to adding a Managed DirectX implementation of the various objects, and it only took a couple of hours. This week I added black hole, which modifies all other objects on the screen to move towards the owner; it took less than 30 minutes to implement the new Behavior and add the code to instantiate it. Design patterns rock. :)

There will be a post soon about a couple odd problems I ran into.