ELEC2645 (2018/19) / Mbed 2 deprecated el17mtu_

Dependencies:   mbed

ModeA/ModeA.h

Committer:
el17mtu
Date:
2019-05-09
Revision:
11:e29b173ccb27
Parent:
10:1c3bdbf2fe9f

File content as of revision 11:e29b173ccb27:

#ifndef MODEA_H
#define MODEA_H

#include "mbed.h"
#include "main.h"
#include "N5110.h"
#include "Gamepad.h"


/** ModeA Class
* @brief Controls the square and the bar 
* @author Maria Ungureanu, University of Leeds
* @date Febraury 2017
*/ 




class ModeA
{

public:
/** Constructor */
    ModeA();
    /** Destructor */
    ~ModeA();
    
    /**
  * @brief Sets the screen
  * @param lcd @details Clears the lcd 
  @code
  void ModeA::screen(N5110 &lcd)
{

    lcd.clear();
    lcd.printString("GAME",0,0);
    lcd.printString("Back:Rules",0,2);
    
    };
  @endcode 
  */
    void screen(N5110 &lcd);
    
    
     /**
  * @brief Sets the screen
  * @param  x_position @details Sets the x coordinate of the square  
  * @param  y_position @details Sets they coordinate of the square  
  * @param  speed @details Sets the speed of the square 
  * @param  gravity @details Sets the value of the gravitational force
  * @param  screen_width @details Sets the value of the gravitational force  
  * @param  bar_width @details Sets the width of the bar 
  * @param  bar_speed @details Sets the speed of the bar 
  * @param  size_top @details Sets the size of the top bar  
  * @param  size_bottom @details Sets the size of the bottom bar  
  @code
  void ModeA::initialise(N5110 &lcd)
 {
    //variables for the square
    x_position = 12;
    y_position = 18;
    speed = 0;
    gravity = 1;
    //variables for the bar
    screen_width = 80;
    bar_width = 10;
    bar_speed = 2;
    
   //score = 1;
    
    //generating random sizes of the bar 
    srand(time(NULL));
    size_top = rand() % 15;
    srand(time(NULL));
    size_bottom = rand() % 15; 
   
     
 }
  @endcode 
  */
    void initialise(N5110 &lcd);
    
  /**
  *@brief 
  */ 
    void Bird(N5110 &lcd);

   
private:

    int x_position;

   int y_position;

   int gravity;
  
   int screen_width;
  
   int bar_width;
  
   int bar_speed;
  
  
   int speed;
  
   int score;
   

    int size_bottom;
  
    int size_top;
    
   
};
#endif