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
Diff: Rock/Rock.h
- Revision:
- 31:27c938ec2a11
- Parent:
- 15:dde4ce4bf7fe
- Child:
- 39:5d4277548303
--- a/Rock/Rock.h Sun May 17 15:15:27 2020 +0000
+++ b/Rock/Rock.h Sun May 17 16:32:36 2020 +0000
@@ -5,16 +5,17 @@
class Rock
{
public:
- void init(int x, int y, int size);
- void render(N5110 &lcd);
- Vector2D get_position();
- void set_life(bool x);
- bool get_life();
+ void init(int x, int y, int size); //sets private variables to inputs
+ void render(N5110 &lcd); //draws rock
+ //accessors and mutators//
+ Vector2D get_position(); //returns position of the rock
+ void set_life(bool x); //sets the life variable of the rock
+ bool get_life(); //returns the life variable of the rock
private:
- int X;
- int Y;
- bool Alive;
- int Size;
+ int _x; //x position of the rock
+ int _y; //y position of the rock
+ bool _life; //life variable
+ int _size; //size of the rock
};
\ No newline at end of file