Space invaders with a nRF2401A wireless joypad

Dependencies:   Gameduino mbed nRF2401A

Fork of Gameduino_Invaders_game by Chris Dick

Gameduino and an nRF2401A hooked up to an mbed on an mbeduino:

/media/uploads/TheChrisyd/2014-03-08_22.53.54.jpg

Revision:
4:bb78bedae411
Parent:
2:20a89dc286d5
--- a/graphics.cpp	Fri Dec 21 13:53:46 2012 +0000
+++ b/graphics.cpp	Sat Oct 26 22:34:08 2013 +0000
@@ -311,7 +311,7 @@
   }
 }
 
-int8 zapShield(int n, int8 x, bool withBullet)
+int8_t zapShield(int8_t n, int8_t x, bool withBullet)
 {
   int y = 0;
   if ((n >= 0) and (n <= 3)) {
@@ -330,7 +330,7 @@
     const sprite_data *blastMap = bullet_blast;
     if (withBullet) {
       // Go from the top, find lowest pixel
-      for (int8 r=0; r<16; ++r) {
+      for (int8_t r=0; r<16; ++r) {
         if ((GD.rd(s)&pixelMask)!=0) {
           y = r;
         }
@@ -343,8 +343,8 @@
       // Go from the bottom, find highest pixel
       y = 16;
       s += 256;
-      int8 offset = 3;
-      for (int8 r=0; r<16; ++r) {
+      int8_t offset = 3;
+      for (int8_t r=0; r<16; ++r) {
         s -= 16;
         // Bombs are wider...we check three columns
         if ((GD.rd(s)&pixelMask)!=0) {
@@ -365,12 +365,12 @@
       blastMap = bomb_blast;
     }
     // Blast a hole in it
-    for (int8 j=0; j<8; ++j) {  // 8 lines tall
+    for (int8_t j=0; j<8; ++j) {  // 8 lines tall
       const int py = y+j;
       if ((py>=0) and (py<=15)) {
         unsigned int blastMask = 0x1000;
         unsigned int blastGraphic = pgm_read_word_near(blastMap);
-        for (int8 i=0; i<8; ++i) {    // 8 pixels wide...
+        for (int8_t i=0; i<8; ++i) {    // 8 pixels wide...
           if ((blastGraphic&blastMask)!=0) {
             // Set shield pixel to 0 where there's a 1 in the source graphic
             int px = x+i;