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 2:bb50c3a9a05c, committed 2020-05-22
- Comitter:
- Nicholas75179
- Date:
- Fri May 22 10:28:29 2020 +0000
- Parent:
- 1:3727d33a171b
- Commit message:
- published 11:27 22/5/2020
Changed in this revision
Spaceship.cpp | Show annotated file Show diff for this revision Revisions of this file |
Spaceship.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3727d33a171b -r bb50c3a9a05c Spaceship.cpp --- a/Spaceship.cpp Fri May 22 10:13:44 2020 +0000 +++ b/Spaceship.cpp Fri May 22 10:28:29 2020 +0000 @@ -162,6 +162,7 @@ lcd.printString(g_buffer, 0, 4); sprintf(g_buffer, "%1.2f,%1.2f", pos_x, pos_y); lcd.printString(g_buffer, 0, 5); + printf("Enemy position: %3.1f,%3.1f\n", pos_x, pos_y); #endif }
diff -r 3727d33a171b -r bb50c3a9a05c Spaceship.h --- a/Spaceship.h Fri May 22 10:13:44 2020 +0000 +++ b/Spaceship.h Fri May 22 10:28:29 2020 +0000 @@ -3,6 +3,10 @@ * @author Nicholas Wu * @date May, 2020 */ + +#ifndef SPACESHIP_H +#define SPACESHIP_H + #include "mbed.h" class Spaceship{ @@ -33,7 +37,8 @@ /** controls import from main * @param Y, A, X, B (bool) from buttons, - * @param x and y (float) from left joystick + * @param x and y (float) from left joystick. + * interacts with private control functions */ void controls(bool player_ship_type, bool Y, bool A, bool X, @@ -70,4 +75,6 @@ /** public function used to call update_bullets and update_position */ void update(); -}; \ No newline at end of file +}; + +#endif \ No newline at end of file