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: Enemy/Enemy1.cpp
- Revision:
- 16:37d98c281eb3
- Parent:
- 14:d0650d0de063
- Child:
- 18:ba4159ab4da7
diff -r a080c64cf301 -r 37d98c281eb3 Enemy/Enemy1.cpp
--- a/Enemy/Enemy1.cpp Mon May 06 18:39:40 2019 +0000
+++ b/Enemy/Enemy1.cpp Wed May 08 09:05:27 2019 +0000
@@ -82,4 +82,19 @@
}
}
return false;
+}
+
+bool Enemy1::collidePlayer(int x, int y, Gamepad &pad) {
+
+ for (int ix = 0; ix < 7; ix++) {
+ for (int iy = 0; iy < 7; iy++) {
+ if ( x + ix == x_enem + 3 &&
+ y + iy == y_enem + 3 ) {
+ pad.tone(400,0.5);
+ return true;
+
+ }
+ }
+ }
+ return false;
}
\ No newline at end of file