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@31:27c938ec2a11, 2020-05-17 (annotated)
- Committer:
- josh_ohara
- Date:
- Sun May 17 16:32:36 2020 +0000
- Revision:
- 31:27c938ec2a11
- Parent:
- 15:dde4ce4bf7fe
- Child:
- 39:5d4277548303
more tidying;
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 | 15:dde4ce4bf7fe | 5 | class Rock |
| josh_ohara | 15:dde4ce4bf7fe | 6 | { |
| josh_ohara | 15:dde4ce4bf7fe | 7 | public: |
| josh_ohara | 31:27c938ec2a11 | 8 | void init(int x, int y, int size); //sets private variables to inputs |
| josh_ohara | 31:27c938ec2a11 | 9 | void render(N5110 &lcd); //draws rock |
| josh_ohara | 31:27c938ec2a11 | 10 | //accessors and mutators// |
| josh_ohara | 31:27c938ec2a11 | 11 | Vector2D get_position(); //returns position of the rock |
| josh_ohara | 31:27c938ec2a11 | 12 | void set_life(bool x); //sets the life variable of the rock |
| josh_ohara | 31:27c938ec2a11 | 13 | bool get_life(); //returns the life variable of the rock |
| josh_ohara | 15:dde4ce4bf7fe | 14 | |
| josh_ohara | 15:dde4ce4bf7fe | 15 | private: |
| josh_ohara | 31:27c938ec2a11 | 16 | int _x; //x position of the rock |
| josh_ohara | 31:27c938ec2a11 | 17 | int _y; //y position of the rock |
| josh_ohara | 31:27c938ec2a11 | 18 | bool _life; //life variable |
| josh_ohara | 31:27c938ec2a11 | 19 | int _size; //size of the rock |
| josh_ohara | 15:dde4ce4bf7fe | 20 | |
| josh_ohara | 15:dde4ce4bf7fe | 21 | }; |