If you would like access to the source code, feel free to message me privately!
I Used Object Oriented Programming (OOP) to implement 13 defensive units for a tower defense game I call Colony Chronicles: Bee Gone. I worked on this project when I took COMPSCI 61A: "Structure and Interpretation of Computer Programs" at UC Berkeley. A demo of the final game can seen here!
This game takes inspiration from PopCap Games' Plants Vs. Zombies.
As the ant queen, you populate your colony with the bravest ants you can muster. Your ants must protect their queen from the evil bees that invade your territory. Irritate the bees enough by throwing leaves at them, and they will be vanquished. Fail to pester the airborne intruders adequately, and your queen will succumb to the bees' wrath.
A game of Ants Vs. SomeBees consists of a series of turns. In each turn, new bees may enter the ant colony. Then, new ants are placed to defend their colony. Finally, all insects (ants, then bees) take individual actions. Bees either try to move toward the end of the tunnel or sting ants in their way. Ants perform a different action depending on their type, such as collecting more food, or throwing leaves at the bees. The game ends either when a bee reaches the end of a tunnel (you lose), or the entire bee fleet has been vanquished (you win).
The files I worked on in this project include were:
ants.py
: The game logic of Ants Vs. SomeBeesants_gui.py
: The original GUI for Ants Vs. SomeBeesgraphics.py
: Utilities for displaying simple two-dimensional animationsutils.py
: Some functions to facilitate the game interfaceucb.py
: Utility functions for CS 61Aassets
: A directory of images and files used bygui.py
img
: A directory of images used byants_gui.py
The game can be run in two modes: as a text-based game or using a graphical user interface (GUI). The game logic is the same in either case, but the GUI enforces a turn time limit that makes playing the game more exciting. The text-based interface is provided for debugging and development.
To start a text-based game, run
$ python3 ants_text.py
To start a graphical game, run
$ python3 gui.py
usage: ants_text.py [-h] [-d DIFFICULTY] [-w] [--food FOOD]
Play Ants vs. SomeBees
optional arguments:
-h, --help show this help message and exit
-d DIFFICULTY sets difficulty of game (test/easy/medium/hard/extra-hard)
-w, --water loads a full layout with water
--food FOOD number of food to start with when testing
Acknowledgments: Tom Magrino and Eric Tzeng developed this project with John DeNero. Jessica Wan contributed the original artwork. Joy Jeng and Mark Miyashita invented the queen ant. Many others have contributed to the project as well!
The new concept artwork was drawn by Alana Tran, Andrew Huang, Emilee Chen, Jessie Salas, Jingyi Li, Katherine Xu, Meena Vempaty, Michelle Chang, and Ryan Davis.