-
Notifications
You must be signed in to change notification settings - Fork 0
/
prototype.h
61 lines (52 loc) · 2.94 KB
/
prototype.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/// Prototype
// Setup
int setupMain(Character &cSetup, Lives lSetup[], Rocks rSetup[], Keyboard &kSetup, PowerUp fallingPowerUps[], InstructionImages &iSetup);
void generateRockLocation(Rocks startPosition[]);
void lifeSetup( Lives a[]);
void characterSetup(Character &a);
int loadImage(Character &imageCharacter, Rocks imageRocks[], Lives imageLives[]);
void initializeUserKeyboard(Keyboard &initialize);
int initializeAllegro();
int loadInstructionImg(InstructionImages &i);
// Play Game
int playGame(bool &continuePlaying, Keyboard &userKeyboard, Character &mainCharacter, Rocks fallingRocks[], Lives userLives[], PowerUp fallingPowerUps[], int &gameMode, Button clickableButton[], Paused &timerPaused, InstructionImages &displayImages);
void userLevel();
int checkIfObjectReachedBottom(Rocks rocksReachedBottom[], PowerUp powerUpReachedBottom[]);
// Collisions
int collisionsMain(Character &mainCharacter, Rocks fallingRocks[], int &numberOfCollisions, Lives userLives[], PowerUp fallingPowerUps[]);
int drawInvinciblity(bool &timerRunning, Character &mainCharacter);
void obtainBoundingBoxes(Character &a, Rocks b[], PowerUp c[]);
void calcBoundingBoxes(Character &a, Rocks &b, PowerUp &c, int object);
void drawBoundingBox(Character &image, Rocks object[], Keyboard &userKeyboard, PowerUp powerUpImg[]);
bool checkCollision(Character &a, Rocks &b, PowerUp &c, bool checkCollisionRocks);
// Movement
void spriteMovement(Character &cMovement, Keyboard &kMovement, Rocks rMovement[], PowerUp pMovement[]);
void keyboardMovement(Keyboard &movement);
void keyboardEvent(int keycode, Keyboard &event, bool keyDown);
void drawSprites(Character &cDraw, Rocks rDraw[], Lives lDraw[], PowerUp pDraw[]);
bool checkIfSlowMoActivated(PowerUp checkSlowMo);
// The end of the program
void exitProgram(Character &image, InstructionImages &displayImages);
int checkHighScore(int playerScore);
void printHighScore(int highScore[]);
int averageHighscore(int playerScore, bool &userScoreAddedToScoreLog);
// PowerUps
int activatePowerUp(PowerUp &userPowerUps, Character &userCharacter);
int setupPowerUps(PowerUp &powerUpSetup);
void powerUpMain(PowerUp &userPowerUps);
int checkIfPowerUpOver(Character &userCharacter);
// Mouse driven interface
void buttonSetup(Button setup[], int gameMode);
void setButtonCoords(Button &button, int upperLeftX, int upperLeftY, int lowerRightX, int lowerRightY);
void drawButtons(Button draw[], int gameMode);
void checkWhichButtonAction(Button check[], int mouseXCoordinate, int mouseYCoordinate, int gameMode, bool buttonClicked);
void checkButtonState(Button state[], int &gameMode, bool &continuePlaying, Keyboard &userKeyboard, Paused &timerPaused);
void checkIfNewGameMode(int newGameMode, int previousGameMode, Button b[]);
// Application
int gameInstructions(InstructionImages &draw);
int credits();
void printFromTextfile(FILE *fptr);
// Misc / Utilities
void pauseTimers(Paused &timerPaused);
void unpauseTimers(Paused &timerPaused);
int checkIfFileLoaded(FILE *fptr);