FrackMan banner

Overview

Period: Feb. 2016 - March 2016
Platform: Xcode
Languages: C++
Gameplay: Link
Description:
FrackMan is a 2D video game similar to the classic arcade game "Dig Dug." It was created as a project for my Data Structures (and OOP) course, CS32, at UCLA. The framework was provided by the professor, but all of the contents of the game, and all of the interactions of the objects with one another were all designed and implemented by myself. The objective of the game is for the player (i.e. FrackMan) to navigate through the dirt in the oil field to find all of the oil barrels for the given level. There are a certain number of enemies (i.e. protesters) each level, who attempt to make FrackMan stop mining for oil by continuously shouting at him (if they are within shouting range). There are two types of protesters: the regular protester and the hardcore protester. The FrackMan player can pick up gold nuggets, which can be placed down as bribes to distract the protesters. If a regular protester picks up a gold nugget, he will immediately leave the oil field and stop bothering the FrackMan. If a hardcore protester picks up a gold nugget, he will stand and admire the gold nugget for a given duration before continuing his pursuit of the FrackMan. The FrackMan player can also pick up pools of water, which serve as ammo to his squirt gun. If a protester takes a certain amount of damage from the squirt gun (note that the hardcore protester has more than double the life of the regular protester), he will leave the oil field in bitter defeat. In addition, the FrackMan player can pick up sonar kits, which can be used to illuminate all objects that can be picked up in a given radius (i.e. gold nuggets and oil barrels). Moreover, the FrackMan can use boulders within the oil field to his advantage by strategically timing his route tunneling through the dirt, so that it will fall on a protester. If the FrackMan player is hit by a boulder, he will be instantly killed. Similarly, if a protester is hit by a boulder, he will proceed to leave the oil field. Lastly, the hardcore protester has a special ability that the regular protester does not have. If the hardcore protester is within a certain radius of the FrackMan player (even if he does not have a direct line of sight of the FrackMan), he can use the FrackMan's GPS signal to hone in on his location and track him down. Finally, the player starts the game with three lives, and every time the player gains an additional score of 100,000 points, an extra live is rewarded. Enjoy! And happy mining!!

This game involved the implementation of a large set of classes to represent each of the in-game objects (i.e. actors). The StudentWorld class serves as the world, in which all of the in-game objects belong to (i.e the oil field). The actors consist of the player (FrackMan), the enemies (regular and hardcore protesters), pickupable goodies (gold nuggets, oil barrels, pools of water, and sonar kits), obstacles (dirt and boulders), and the FrackMan's squirt gun ammunition (water squirts). Implementing all of these classes involved strategically creating a certain set of base classes, and the corresponding derived classes to exploit similarities in both functionality and private variables. Moreover, this project involved implementing an in-game timing mechanism (based off of a frequency determined by the game framework), in which objects interact and do specific actions on each tick of the game clock. Lastly, implementation of the protester classes involved implementing a Queue-Based Maze-Searching Algorithm in the form of a Depth-First Search in order for the protesters to find the exit point of the oil field upon being killed, and for the hardcore protesters, honing in on the FrackMan's location.


GitHub Source Code