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:
- 130:4ce67451d0c1
- Parent:
- 111:e9a048d06690
- Child:
- 131:2084e4a8338f
--- a/Spaceship/Spaceship.cpp Mon May 06 00:16:25 2019 +0000
+++ b/Spaceship/Spaceship.cpp Mon May 06 13:47:06 2019 +0000
@@ -29,19 +29,22 @@
{
_speed_spaceship = int(mag*10.0f);
- if(d==N)
- //pong.update(pad);
- //render();
+ if(d==N){
+ // printf("North\n");
_y_spaceship-=2;
+ }
else
- if(d==S)
+ if(d==S){
_y_spaceship+=2;
+ }
- if(_y_spaceship>=30)
+ if(_y_spaceship>=30){
_y_spaceship=30;
+ }
else
- if(_y_spaceship<=0)
+ if(_y_spaceship<=0){
_y_spaceship=0;
+ }
}