Development Notes: ‘Roach Attack’

Jul 10

Roach Attack was the first complete computer game that I created. It began as a simple programming exercise to create a representation of a real-world relationship using only the mouse and a plain square.

Reactive Square Screenshot

The program I wrote had a small grey square that would run frantically away from the cursor. If it got far enough away from the cursor it would ‘hide’ by changing color to match the background. You could ‘squish’ the bug by clicking it, which would make it turn orange and get bigger.

This initial sketch and the final game were both written in the Processing programming environment. Processing is a great development environment for artists. It provides a relatively easy way to visualize your ideas and get them working quickly.

View the Reactive Square program
Download Source Code (*see note about compatibility below)

The next step was to transform this basic sketch into a full-fledged game.

It isn’t much fun to chase one roach around, so I programmed a Roach Object. The roach object controls the basic behavior of a roach, but it can be used over and over to create a disgusting infestation of roaches—perfect!

I changed the game play by adding a time component. Each roach has a timer on his back that indicates how long he has before he breeds. If you don’t kill a roach before his timer reaches zero, his timer resets and a new roach is created. An Infestation Meter at the bottom of the screen indicates how many roaches there are in your kitchen. The game is won by killing 200 roaches before the infestation meter reaches a critical level.

Two hundred roaches is a lot if you’re just squishing them with your mouse. We need some special weapons to allow you to kill many roaches at once. I added two special weapons: bug bombs and bug spray. You obtain the special weapons by killing a special blue or green roach. Bug bombs can be placed near a large cluster of roaches. When it detonates it kills any roach within range. The bug spray works pretty much like real bug spray, killing any bug you spray. An indicator on the side of the can shows how much spray remains.

I used a photo of my kitchen counter as the screen background. I put in a spoon and a tea package to give them something to hide under.

Many people complained the game was too hard. It is quite difficult if you don’t know the trick (chase the roaches into the corners). I added three levels of difficulty to appease my critics. When people still complained that it was too hard, I added a Custom Level option where the user can choose how fast the roaches move and how often they breed. They can also enable a Cheat Mode that will allow them to call up the special weapons at any time.

Roach Attack

Play Roach Attack
Download Source *

*Warning: This game was created with Processing version 74. It is unlikely that this source code will work with the current version of Processing (115) without modification.