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 Gamepad N5110 mbed-rtos
Diff: Spacecraft/Spacecraft.cpp
- Revision:
- 2:b5c1bb7a39de
- Parent:
- 0:99fa5a619081
- Child:
- 5:016a7315b75d
diff -r 45493d1d0689 -r b5c1bb7a39de Spacecraft/Spacecraft.cpp
--- a/Spacecraft/Spacecraft.cpp Fri Apr 19 13:43:22 2019 +0000
+++ b/Spacecraft/Spacecraft.cpp Sat Apr 20 00:08:00 2019 +0000
@@ -11,22 +11,6 @@
}
-//int spacecraft [11][11] = {
-
- // { 0,0,0,0,0,1,0,0,0,0,0 },
- // { 0,0,0,0,0,1,0,0,0,0,0 },
- // { 0,0,0,0,1,1,1,0,0,0,0 },
- // { 0,0,0,0,1,0,1,0,0,0,0 },
- // { 0,1,0,1,0,0,0,1,0,1,0 },
- // { 1,1,1,0,0,0,0,0,1,1,1 },
- // { 0,1,0,0,0,0,0,0,0,1,0 },
- // { 0,1,0,1,0,0,0,1,0,1,0 },
- // { 1,1,1,0,1,0,1,0,1,1,1 },
- // { 0,1,0,0,1,1,1,0,0,1,0 },
- //{ 0,0,0,0,0,1,0,0,0,0,0 },
-
-
-//};
int H_spacecraft [11][11] = {
@@ -43,54 +27,12 @@
{ 0,0,1,0,0,1,0,0,0,0,0 },
-};
-
-//int enemy21 [7][7] ={
-
-//{0,0,0,0,0,1,1},
-//{0,0,0,0,0,1,1},
-//{0,0,0,0,1,0,0},
-//{0,0,0,1,0,0,0},
-//{0,0,1,0,0,0,0},
-//{1,1,0,0,0,0,0},
-//{1,1,0,0,0,0,0},
-
-//};
-
-//int enemy22 [7][7] ={
-
-//{1,1,0,0,0,0,0},
-//{1,1,0,0,0,0,0},
-//{0,0,1,0,0,0,0},
-//{0,0,0,1,0,0,0},
-//{0,0,0,0,1,0,0},
-//{0,0,0,0,0,1,1},
-//{0,0,0,0,0,1,1},
-
-//};
-
-//int boss [13][13] = {
-
-//{0,0,0,0,0,1,1,1,1,1,0,0,0},
-//{0,0,0,0,0,0,1,1,1,0,0,0,0},
-//{0,0,1,1,1,1,1,1,1,1,1,1,1},
-//{0,0,0,0,0,1,0,1,0,0,1,0,0},
-//{0,0,0,0,1,0,1,0,1,0,1,0,0},
-//{0,0,0,1,0,0,0,1,0,1,1,0,0},
-//{1,1,1,1,0,1,0,1,0,1,1,0,0},
-//{0,0,0,1,0,0,0,1,0,1,1,0,0},
-//{0,0,0,0,1,0,1,0,1,0,1,0,0},
-//{0,0,0,0,0,1,0,1,0,0,1,0,0},
-//{0,0,1,1,1,1,1,1,1,1,1,1,1},
-//{0,0,0,0,0,0,1,1,1,0,0,0,0},
-//{0,0,0,0,0,1,1,1,1,1,0,0,0},
-
-//};
+};
void Spacecraft::init(int x,int y)
{
- _x = x; // x value on screen is fixed
- _y = y;
+ _x = x; // default x position
+ _y = y; // default y position
_speed = 1; // default speed
_health = 0; // start health from zero
@@ -98,7 +40,7 @@
void Spacecraft::character(N5110 &lcd)
{
- // draw paddle in screen buffer.
+ // draw the player's spacecraft in screen buffer.
lcd.drawSprite(_x,_y,11,11,(int *)H_spacecraft);
}