contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

main.cpp

Committer:
OmarAlebiary
Date:
2019-04-19
Revision:
23:2ca9735b16ef
Parent:
22:3e6ff378d651
Child:
25:7e3b6df93dd5

File content as of revision 23:2ca9735b16ef:

#include "RocketRacer.h"
#include "Menus.h"


// objects 

/**
  * @brief initializing the Gamepad object
  */
Gamepad pad;
/**
  * @brief initializing the RocketRacer object
  */
RocketRacer Rocket_Racer;
/**
  * @brief initializing the lcd object and assigning the pins on the gamepad to it
  */
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); 
/**
  * @brief initializing the Menus object
  */
Menus menus;

// prototypes
/**
  * @brief object initialization method
  * @param None @details method that initializes objects like lcd,gampad and sets the default
  * contrast of the lcd and brightness 
  */
void setup();
/**
  * @brief main method
  * @param None @details main method that has all the method calls of the Menus.cpp and 
  * the RocketRacer class and has the Game_Loop method that runs the game
  */
int main();



void setup(){
    
    lcd.init();//initialize the lcd
    pad.init();//initialize the pad
    lcd.clear();
    lcd.setBrightness(0.4);//sets the default brightness
    lcd.setContrast(0.55);//set the default contrast
    lcd.normalMode();
    
    }
    

    
    
int main(){
    
    
    setup();
    menus.welcomeMenu(pad,lcd); 
    
    menus.InstructionsMenu(pad,lcd);
    //keeps looping untill the player loses
    while(1){
        Rocket_Racer.Game_Loop(lcd,pad);
    }


}