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 Gamepad2 ELEC2645_Project_el18rg
Dependents: ELEC2645_Project_el18rg
Diff: Swatter/Swatter.cpp
- Revision:
- 22:0b207694a5f7
- Parent:
- 19:bdfab290446a
--- a/Swatter/Swatter.cpp Fri May 29 21:16:37 2020 +0000
+++ b/Swatter/Swatter.cpp Fri May 29 21:31:43 2020 +0000
@@ -5,11 +5,11 @@
void Swatter::init(int x,int height,int width) //initilises the swatter parameters
{
- _x = x;
- _y = HEIGHT - 10;
- _height = height;
- _width = width;
- _speed = 1;
+ _x = x; //x-axis of swatter
+ _y = HEIGHT - 10; //y-axis of swatter
+ _height = height; //height
+ _width = width; //width
+ _speed = 1; //speed
}
void Swatter::draw(N5110 &lcd) //draws the swatter
@@ -39,8 +39,8 @@
if (_x < 1) { //stops the swatter moving off the left side of the screen
_x = 1;
} //stops the swatter moving off the right side of the screen
- if (_x > WIDTH - _width - 1) {
- _x = WIDTH - _width - 8;
+ if (_x > 75) {
+ _x = 75;
}
}