Buildy Dodge

Buildy Dodge is available for free here.

A Video Description of the game can be found here.

Buildy Dodge is an arcade-style game I designed for CSCI 1310 at CU Boulder. The premise is as follows: You are a rectangle who is being bombarded with missiles. Your job, of course, is to dodge them. This can be done in one of two ways, you can build blocks to stop the missiles, or you can simply try to move out of their way. Unfortunately for you, the missiles destroy any block they touch and they progressively get faster. You will need to keep building blocks to keep from falling to your death. You can build blocks anywhere in the black area.

If you fall, you lose a life; if you are hit by a missile, you lose a life. You start with twenty lives.

The core of this game is a dictionary of each of the following blocks:

Grid layout of Buildy Dodge's map.
Figure 1.

If the key “A1” in the dictionary corresponds to a value of 1, then a block exists there. Otherwise, there is no block there. A function takes this dictionary and displays all the blocks that should be present. A series of if statements create boundaries around these blocks while they exist.

The code for this program gets a little messy because every block needs to be treated like a wall,

and since walls are constantly being built and destroyed, it is easy to find the character inside one or more walls at any time. To address this, each block’s coordinates are recorded in dictionaries. If the program detects that a motion would cause the character to touch a block, it uses these dictionaries, as well as the dimensions of the character and the block, to determine what side of the block the character is on. If the character tries to move into a block from the side, the x coordinate of the character will not update. If the character tries to move into the block from the top or bottom, the y coordinate of the component is moved upward and all other factors of y movement are ignored. This has the effect of always lifting the character upwards if it becomes stuck inside a block.

The character falls at a constant speed of “gravity.” The motion of the character is determined by pygame inputs (Arrow Keys and Spacebar). Once the player loses all their lives, a screen displays the final points and “GAME OVER.” One aesthetically pleasing feature is that the game continues to play in the background; although, the player cannot build blocks and the score does not increase.

How to play:

Starting the game

  1. If you do not have python downloaded, follow the instructions below:
  2. This game runs on python and requires pygame to be downloaded. Type “sudo apt-get install python-pygame” into the terminal and hit ENTER. If this returns nothing, pygame has been successfully installed.
  3. Download and unzip Buildy Dodge
  4. Navigate to the directory where you unzipped the Buildy Dodge folder.
  5. Start the game by typing “python” into the terminal and hit ENTER


  1. Use the arrow keys to move. Up will make the character jump. It will also allow you to climb up any existing blocks.
  2. Use spacebar to build a block . You will be moved up above the block
  3. You get one point for every missile that does not hit you, including those which hit blocks.
Unable to display content. Adobe Flash is required.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s