The AntMan

End Semester Project: Object Oriented Programming

Spring Session 2016


Have you ever wondered what it would be like if you could become the size of an ant or double the size you are? If not, you are certainly going to get a strong idea through this game.
The AntMan is a role playing game game of the very idea, orchestrated on the basis of a fictional Marvel movie character, Ant Man.

The concept of Object Oriented Programming has been implemented in the making of this game.
You’d be wondering what Object Oriented Programming is. Well Object-oriented programming (OOP) is a programming language model organized around objects rather than “actions” and data rather than logic. One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects.

Even when you have an idea and the immaculate basis of Object Oriented Programming, a programmer certainly needs a platform to transform his visionary ideas into graphical output. The platform we used is Unity – Game Engine. Some of the famous games such as Temple Run Trilogy, Assassin’s Creed: Identity, Dead Trigger, Tiger Woods PGA Tour were made using this very platform.
Unity is primarily a cross-platform game engine developed by Unity Technologies and used to develop video games for PC, consoles, mobile devices and websites. Unity is notable for its ability to target games to multiple platforms. Within a project, developers have control over delivery to mobile devices, web browsers, desktops, and consoles.

The AntMan is first person game designed in 3D. The character has to perform certain tasks such as to reach from one place to another which involves using strategies, real life actions such as jumping, running and its size changing capabilities. This thrilling and adventure game demands keen on-screen observation.

The coding of The AntMan is done in C Sharp. There has been an intense use of scripting in the game development, for instance there’s a script named ‘char control’ which is used to control all the possible actions of the character. The wonders of Object Oriented Programming kicks in here, making us realize that all actions such as running, moving, jumping, size up, size down etc. every action is catered within this script. Some of the functions used in the script are:

void OnCollisionEnter (Collision col) {

if ( == “Floor”) {
grounded = true;
print (“Grounded”);
if (col.gameObject.tag == “Mutant”) {
col.gameObject.GetComponent<Animator> ().SetBool (“Punch”, true);
col.gameObject.GetComponent<Enemy> ().active = false;
if (col.gameObject.tag == “Level”) {
GameObject.Find(“TextB”).GetComponent<Text>().enabled = true;
Time.timeScale = 0.5f;
Application.LoadLevel(Application.loadedLevel + 1);
if (col.gameObject.tag == “Health”) {
print (“Health Recieved”);
HealthFull = true;
source.PlayOneShot (FullHealth);
Destroy (col.gameObject);
if ( == “InstrA”) {
GameObject.Find(“TextD”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
if ( == “InstrB”) {
GameObject.Find(“TextE”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
Invoke (“InstructionsOff”, 5f);
if ( == “InstrC”) {
GameObject.Find(“TextF”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
Invoke (“InstructionsOff”, 5f);
if ( == “InstrD”) {
GameObject.Find(“TextG”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
if ( == “InstrE”) {
GameObject.Find(“TextH”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
Invoke (“InstructionsOff”, 5f);
if ( == “InstrF”) {
GameObject.Find(“TextI”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
Invoke (“InstructionsOff”, 5f);
if ( == “InstrG”) {
GameObject.Find(“TextJ”).GetComponent<Text>().enabled = true;
Destroy (col.gameObject);
Invoke (“InstructionsOff”, 5f);

The OnCollisionEnter function enables us to detect collisions and perform appropriate actions. The function has been used to give onscreen instructions, helping the player to learn while playing this frenzy.

Similarly, there’s another script named ‘pad button’ script which is used to open and close doors. Now the advantage Object Oriented Programming gives us here is that this script can be used to move even a stone or any object (if we implement the script on the particular object). All classes are derived from Unity 3D engine’s mono-behavior class.

Some of the basic controls in the game are mentioned below. Furthermore, as you progress in the game, the hints keep on introducing you with new possible actions and keys.

Arrow keys (↑↓←→) and W,A,S,D keys for movement.
E Key for light up power
Q Key for size change
Shift Key for sprint
Space Key for jump
+,= keys for changing camera viewing angle
F Key to Shoot Magic Effects to kill enemies

The Demo Video is:



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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s