Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Rock/Rock.h@39:5d4277548303, 2020-05-25 (annotated)
- Committer:
- josh_ohara
- Date:
- Mon May 25 16:27:29 2020 +0000
- Revision:
- 39:5d4277548303
- Parent:
- 31:27c938ec2a11
Initial Deoxygen documentation completed
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| josh_ohara | 15:dde4ce4bf7fe | 1 | #include "mbed.h" |
| josh_ohara | 15:dde4ce4bf7fe | 2 | #include "N5110.h" |
| josh_ohara | 15:dde4ce4bf7fe | 3 | #include "Gamepad.h" |
| josh_ohara | 15:dde4ce4bf7fe | 4 | |
| josh_ohara | 39:5d4277548303 | 5 | /** Rock Class |
| josh_ohara | 39:5d4277548303 | 6 | @author Joshua Ohara, el18jkeo, 201291390 |
| josh_ohara | 39:5d4277548303 | 7 | @brief Creates and control the rocks which make up the cover |
| josh_ohara | 39:5d4277548303 | 8 | @date May 2020 |
| josh_ohara | 39:5d4277548303 | 9 | */ |
| josh_ohara | 39:5d4277548303 | 10 | |
| josh_ohara | 15:dde4ce4bf7fe | 11 | class Rock |
| josh_ohara | 15:dde4ce4bf7fe | 12 | { |
| josh_ohara | 15:dde4ce4bf7fe | 13 | public: |
| josh_ohara | 39:5d4277548303 | 14 | |
| josh_ohara | 39:5d4277548303 | 15 | /**Sets the starting value of private variables*/ |
| josh_ohara | 31:27c938ec2a11 | 16 | void init(int x, int y, int size); //sets private variables to inputs |
| josh_ohara | 39:5d4277548303 | 17 | |
| josh_ohara | 39:5d4277548303 | 18 | /**Draws the rock of it is alive*/ |
| josh_ohara | 31:27c938ec2a11 | 19 | void render(N5110 &lcd); //draws rock |
| josh_ohara | 39:5d4277548303 | 20 | |
| josh_ohara | 39:5d4277548303 | 21 | |
| josh_ohara | 31:27c938ec2a11 | 22 | //accessors and mutators// |
| josh_ohara | 39:5d4277548303 | 23 | |
| josh_ohara | 39:5d4277548303 | 24 | /*Returns a 2D vector of the position of the rock |
| josh_ohara | 39:5d4277548303 | 25 | *@return rock position (Vector2D) |
| josh_ohara | 39:5d4277548303 | 26 | */ |
| josh_ohara | 31:27c938ec2a11 | 27 | Vector2D get_position(); //returns position of the rock |
| josh_ohara | 39:5d4277548303 | 28 | |
| josh_ohara | 39:5d4277548303 | 29 | /**Sets the life value of the rock |
| josh_ohara | 39:5d4277548303 | 30 | *@param _life (bool) |
| josh_ohara | 39:5d4277548303 | 31 | */ |
| josh_ohara | 31:27c938ec2a11 | 32 | void set_life(bool x); //sets the life variable of the rock |
| josh_ohara | 39:5d4277548303 | 33 | |
| josh_ohara | 39:5d4277548303 | 34 | /**Returns the life value of the rock |
| josh_ohara | 39:5d4277548303 | 35 | *@return _life (bool) |
| josh_ohara | 39:5d4277548303 | 36 | */ |
| josh_ohara | 31:27c938ec2a11 | 37 | bool get_life(); //returns the life variable of the rock |
| josh_ohara | 15:dde4ce4bf7fe | 38 | |
| josh_ohara | 15:dde4ce4bf7fe | 39 | private: |
| josh_ohara | 31:27c938ec2a11 | 40 | int _x; //x position of the rock |
| josh_ohara | 31:27c938ec2a11 | 41 | int _y; //y position of the rock |
| josh_ohara | 31:27c938ec2a11 | 42 | bool _life; //life variable |
| josh_ohara | 31:27c938ec2a11 | 43 | int _size; //size of the rock |
| josh_ohara | 15:dde4ce4bf7fe | 44 | |
| josh_ohara | 15:dde4ce4bf7fe | 45 | }; |