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: 4DGL-uLCD-SE PinDetect mbed
Diff: gobbleBuzz.cpp
- Revision:
- 0:56c7173428ac
diff -r 000000000000 -r 56c7173428ac gobbleBuzz.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gobbleBuzz.cpp Tue Nov 22 16:42:02 2022 +0000
@@ -0,0 +1,34 @@
+#include "gobbleBuzz.h"
+#include "uLCD_4DGL.h"
+
+
+#define TURKEY_HEIGHT 8
+#define TURKEY_WIDTH 11
+
+extern uLCD_4DGL uLCD;
+
+bool GobbleBuzz::overlap(int upperLX, int upperLY, int lowerRX, int lowerRY)
+{
+
+ int lrxpos = xpos+TURKEY_WIDTH;
+ int lrypos = ypos+TURKEY_HEIGHT;
+
+ //first check to see if in the upper left corner of turkey is in rectangle
+ if (((xpos >= upperLX) && (xpos <= lowerRX)) //then x pos satisfied
+ && ((ypos >= upperLY) && (ypos <=lowerRY)))
+ return true;
+ //now check to see if the lower right corner of the turkey is in the rectangle
+ else if ( ((lrxpos >= upperLX) && (lrxpos <= lowerRX)) //then x pos satisfied
+ && ((lrypos >= upperLY) && (lrypos <= lowerRY)) )
+ return true;
+ //now check to see if the upper right corner of turkey is in rectangle
+ else if ( ((lrxpos >= upperLX) && (lrxpos <= lowerRX)) //then x pos satisfied
+ && ((ypos >= upperLY) && (ypos <= lowerRY)) )
+ return true;
+ //now check to see if the lower left corner of the turkey is in rectangle
+ else if ( ((xpos >= upperLX) && (xpos <= lowerRX)) //then x pos satisfied
+ && ((lrypos >= upperLY) && (lrypos <= lowerRY)) )
+ return true;
+ else //no overlap
+ return false;
+}
\ No newline at end of file