contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

main.cpp

Committer:
OmarAlebiary
Date:
2019-04-20
Revision:
26:35714debc45f
Parent:
25:7e3b6df93dd5
Child:
27:771d186b1bc8

File content as of revision 26:35714debc45f:

#include "RocketRacer.h"
#include "Menus.h"
#include "tests.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;
/**
  * @brief initializing the tests object
  */
tests test;

// 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();
//      test.test_welcomeMenu(pad,lcd);
//      test.test_PlayMelody(pad);
//      test.test_drawMenu(lcd, pad);
//      test.test_credits_page(lcd,pad);
//      test.test_loading_menu(lcd);
//      test.test_InstructionsMenu(pad,lcd);
//      test.test_Game_Loop(pad,lcd);
    
    menus.welcomeMenu(pad,lcd);
    menus.loading_menu(lcd);
    pad.leds_off();
    
    while(1){
    menus.drawMenu(lcd,pad);
    }
    
    

}