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 4DGL-uLCD-SE PinDetect
overlap.cpp
00001 #include "ScreenObject.h" 00002 #include "uLCD_4DGL.h" 00003 extern uLCD_4DGL uLCD; 00004 bool overlap(ScreenObject & a, ScreenObject & b){ 00005 #define EARTH_WIDTH 10 00006 #define EARTH_HEIGHT 10 00007 #define ASTEROID_HEIGHT 12 00008 #define ASTEROID_WIDTH 15 00009 // int w = a.xpos; 00010 // uLCD.printf("%i", w); 00011 if ( ((a.xpos + 6) > (b.xpos)) && ((a.xpos) <= (b.xpos+10)) ){ 00012 if ( ((a.ypos) <= (b.ypos+6)) && ((a.ypos+6) >= (b.ypos)) ){ 00013 return true; 00014 } 00015 } 00016 return false; 00017 }
Generated on Fri Jul 15 2022 00:38:40 by
1.7.2