ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Rock/Rock.h

Committer:
josh_ohara
Date:
2020-05-25
Revision:
39:5d4277548303
Parent:
31:27c938ec2a11

File content as of revision 39:5d4277548303:

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

/** Rock Class
@author Joshua Ohara, el18jkeo, 201291390
@brief Creates and control the rocks which make up the cover 
@date May 2020
*/ 

class Rock
{
public: 

    /**Sets the starting value of private variables*/
    void init(int x, int y, int size);                                          //sets private variables to inputs
    
    /**Draws the rock of it is alive*/
    void render(N5110 &lcd);                                                    //draws rock
    
    
    //accessors and mutators//
    
    /*Returns a 2D vector of the position of the rock
    *@return rock position (Vector2D)
    */
    Vector2D get_position();                                                    //returns position of the rock
    
    /**Sets the life value of the rock
    *@param _life (bool)
    */
    void set_life(bool x);                                                      //sets the life variable of the rock
    
    /**Returns the life value of the rock
    *@return _life (bool)
    */
    bool get_life();                                                            //returns the life variable of the rock
    
private:
    int _x;                                                                     //x position of the rock
    int _y;                                                                     //y position of the rock
    bool _life;                                                                 //life variable
    int _size;                                                                  //size of the rock

};