About Me




Flash Games

Cellular Automata

Mittens Massacre



Mittens Massacre




Mittens Massacre is a physics based game where the player launches a cat from a cannon towards pigeons and yarn. I worked with an artist on this project. She did all of the art and I did all of the programming.

This project was an assignment for a class, CS335 Game Design and Development. We were assigned to a group of three at random, however, one of our group members did not contribute to the project and we ended up completing all her tasks also.

The assignment had the following requirements:

  • Must use C# and XNA Game Studio 3.1
  • Must be 2D
  • Cannot use any external libraries or source
  • Must be started and completed during that semester

Technical Features

  • Accurate 2D physics using closest-point algorithms
  • Generalized high-level input manager
  • Debugging view shows bounding areas and velocities
  • Debugging physics timesteps
  • Mouse-driven real-time level editor
  • Implemented entirely with composition, no inheritance is used
  • XML describes levels and automatic XNB deserialization to load the levels as binary


The basic gameplay mechanic is to launch a cat, Mittens, from a cannon towards a ball of yarn. There are three pigeons in each level, the goal is to collect ALL three and then exit the level by hitting the yarn. If pigeons are ignored it's trivial to beat the level, however, collecting all three pigeons and the yarn is extremely difficult.

There are various environmental hazards, some lethal and some not. For example, in the first level there exists a hobo on the park bench that will yell at Mittens if he hits him. Also, in the second level, Grandma's House, she keeps a space heater going, which is certain death if poor Mittens makes contact.

Mittens will also die if he hits too many walls or loses too much speed.

(Note: video has sound)

Get the Flash Player to see this video.


While programming the physics systems it was clear that I needed a way to debug the system. The first step was to create special rendering classes that when given a collidable area render a debug overlay.

The second step was to slow the physics system down to be able to watch the collisions step-by-step. This is implemented so that a special stepping mode is activated by a key press, but is only available in the debug builds. This allows for traditional debugging techniques to be used with the continuous nature of the physics system.

The video shows both the debugging overlay and the timestep modes.

Get the Flash Player to see this video.


The editor is mouse-driven, using simple drag-n-drop to place pieces. It supports all the kinds of manipulation the physics system does: creation, deletion, placement, rotation, sizing. The editor supports serializing and deserializing through an XML file.

In the video you can see the physics system is entirely real-time and moving a piece instantly updates the physics.

Get the Flash Player to see this video.

Code Sample

Click 'show source' to view a code sample from OBB.cs. This is the implementation of the oriented bounding boxes that make up the majority of collidable objects. The physics system queries the OBB to determine if it is colliding with the cat. The OBB returns information on whether there is a collision, and if so the collision normal and penetration depth. These values are used by the physics system to 'reverse' the collision and send the cat on its way and in the proper direction.



Visual Studio 2008 Solution (Codenamed BouncyCatIsBouncy)

SVN: http://svn.danwellman.com/mittens/trunk/

(music removed due to copyright reasons)

(exe requires .NET 3.5 and the XNA 3.1 Redistributable to be installed)