ArkavQuarium is an implementation of InsaniQuarium using C++. It includes code to handle sprite changes to generate animation.
make all
Main controller, has update function that will call each Aquarium object's update function.
Function | Description |
---|---|
void update() | Call update method in all objects |
Aquarium class serve as the interface between object in the aquarium. Because each object in the aquarium object has a refference to Aquarium class theoritically they can access every instance of object that Aquarium has.
Serve as a parent class for all objects in the Aquarium, with each object have access to all other AquariomObjects using Aquarium interface.
Abstract class for all the fish in the Aquarium (currently Guppy and Piranha). As Aquarium class saved list of Fish extending Fish class will not break the main program. Also controls the time until the fish hungry or dead.
Function | Description |
---|---|
void findNearestFood() | Find nearest food that is suitable for the Fish |
void produceCoin() | Instantiate a coin |
void move() | Move according to direction Fish |
void eat() | Eat Food in the same position as the Fish |
Normal fish in the Aquarium. Able to eat food objects in the Aquarium, it will also try to steer it's move to the nearest food if it is currenlty hungry. Generate coins after T time.
Carnivore fish in the Aquarium. Able to eat Guppy that lives inside the Aquarium, produce coins after eating Guppy. It will move according to the position of the nearest Guppy in the surrounding, will not eat if it feels full.
Implementation of Food interface, have normal behaviour, upgrading a fish one stage everytime it gets eaten.
Interface for all the food class in the Aquarium.
Interface for all the coins class in the Aquarium. The purpose of using interface is if someone wanted to add an extension to a coins object they will not need to update main Aquarium function as Aquarium save list of object interface.
Implementation of Coin interface, have normal behaviour, increasing the amount of coins the player had by 1.
Interface for all the snail in the Aquarium. Serve as a base to add another implementation of Snail.
Implementation of Snail interface, have normal behaviour, collection all the nearest coins on the bottom of the aquarium.
Function | Description |
---|---|
void getNearestCoin() | Find the position of the nearest coin |
Simple structure to save the position of each aquarium object
Simple structure to save the direction of each object, Direction is specified as four booleans, UP, DOWN, RIGHT, LEFT with it having true means that the object is going into that direction.
Helper class to save all the objects in the Aquarium. Implemented using double linked list