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: Spaceship/Spaceship.cpp
- Revision:
- 18:53017c90bd26
- Parent:
- 16:106c27d03402
--- a/Spaceship/Spaceship.cpp Tue May 08 08:24:22 2018 +0000
+++ b/Spaceship/Spaceship.cpp Tue May 08 11:10:34 2018 +0000
@@ -38,7 +38,7 @@
{
_speed = int(mag*10.0f); //shows how far from the center does the Spaceship move based on the joystick
- // update y and x values based on direction of movement
+ // update y and x values based on direction of joystick movement
if (d == N) {
_y-=_speed;
} else if (d == S) {
@@ -49,6 +49,7 @@
_x+=_speed;
}
+
// check the Spaceship coordinates so it doesn't go off screen
if (_y < 1) {
_y = 1;