A simple asteroids-like game utilizing various Mbed-compatible sensors

Dependencies:   mbed 4DGL-uLCD-SE PinDetect

Committer:
sralph3
Date:
Thu Jan 03 19:56:27 2019 +0000
Revision:
8:137330cfe63d
Parent:
0:f2cc64948895
Jan 3, 2019

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sralph3 0:f2cc64948895 1 #include "ScreenObject.h"
sralph3 0:f2cc64948895 2 #include "uLCD_4DGL.h"
sralph3 0:f2cc64948895 3 extern uLCD_4DGL uLCD;
sralph3 0:f2cc64948895 4 bool overlap(ScreenObject & a, ScreenObject & b){
sralph3 0:f2cc64948895 5 #define EARTH_WIDTH 10
sralph3 0:f2cc64948895 6 #define EARTH_HEIGHT 10
sralph3 0:f2cc64948895 7 #define ASTEROID_HEIGHT 12
sralph3 0:f2cc64948895 8 #define ASTEROID_WIDTH 15
sralph3 0:f2cc64948895 9 // int w = a.xpos;
sralph3 0:f2cc64948895 10 // uLCD.printf("%i", w);
sralph3 0:f2cc64948895 11 if ( ((a.xpos + 6) > (b.xpos)) && ((a.xpos) <= (b.xpos+10)) ){
sralph3 0:f2cc64948895 12 if ( ((a.ypos) <= (b.ypos+6)) && ((a.ypos+6) >= (b.ypos)) ){
sralph3 0:f2cc64948895 13 return true;
sralph3 0:f2cc64948895 14 }
sralph3 0:f2cc64948895 15 }
sralph3 0:f2cc64948895 16 return false;
sralph3 0:f2cc64948895 17 }