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
Revision 18:53017c90bd26, committed 2018-05-08
- Comitter:
- RehamFaqehi
- Date:
- Tue May 08 11:10:34 2018 +0000
- Parent:
- 17:d7eea81e7222
- Commit message:
- Final Submission. I have read and agreed with Statement of Academic Integrity.
Changed in this revision
| Spaceship/Spaceship.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r d7eea81e7222 -r 53017c90bd26 Spaceship/Spaceship.cpp
--- 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;