Program Description:
Important Variables:
- gamescore and top5scores[5]: gamescore stores the score while the game is being played and top5scores[5] stores the top 5 highscores.
- x_pos, y_pos, xcoordinate, and ycoordinate: these variables store the x coordinate and y coordinate when the user touches the screen.
- speed: stores travel speed of rectangles.
- color: randomized integer that determines color of rectangles.
Functions:
- void MainMenu();
- creates the main menu when called
- void PlayGame();
- controls the portion of the code where the game is actually played
- void touch();
- checks to see what part of main menu was touched
- void instructions();
- prints instructions on a new screen
- void highscore(int hs);
- prints out top high scores on a new screen
- void credits();
- displays credits
- void quit();
- displays a nice message
In class highscores:
- highscores();
- constructor that initializes each element of top5scores to 0
- void minreplace(int a);
- Finds lowest high score, and if new game score is higher than that, replaces the lowest high score with game score.
- void highscoresort(int x[5]);
- Sorts top 5 high scores
INSERT LINK TO ALGORITHM HERE