ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

game/game.h

Committer:
Noximilien
Date:
2019-04-15
Revision:
29:579e00b7f118
Parent:
28:35af3843de8f
Child:
30:d454d0cb72bc

File content as of revision 29:579e00b7f118:

#ifndef GAME_H
#define GAME_H

/** This variable is used in game.cpp, enemy.h, player.h and hud.h*/
extern int game_score;
extern int score_count_for_difficulty;
extern int player_lifes;
extern bool red_led_state;
extern int red_led_flashing;
extern int high_score;

/** Game Class
 * @brief A library for drawing the game.
 * @author Dmitrijs Griskovs
 * @date 15/04/2019
 */
class Game{
public:
/** @brief The main game function where all the gamplay happens.
 * @details This is the main function of game.cpp, where the actual gameplay happens.
 * Here all other functions are activeated, and when the player dies, it
 * returns back to main menu "main.cpp".
 * @returns bool want_to_pause, when "START" butto nis pressed.
 */
    bool updateAndDraw();
/** @brief Resets all the in game variable when new game begins.
 * @details This function resets all the values to their intial states when 
 * the game is first began when the player dies and wants to restart the game.
 * It does not reset the values when the game is paused.
 */  
    void startNewGame();
private:
    bool checkForGameOver();
    void collideEnemiesAndBlasts();
    void collideEnemiesBlastsAndPlayer();
    void collideEnemiesAndPlayer();
    void starsSpawnDelay();
    void increaseGameDifficultyAndEnemySpawnDelay();
    void gameOver();
    void drawGameOver();
    void ledsGameOver();
    void musicGameOver();
    void printMusicCountersTest();
    void lowFrequencyPartMusic();
    void highFrequencyPartMusic();
};


#endif