Laser tag guns code https://os.mbed.com/users/ddakev/notebook/laser-tag-system/
Dependencies: mbed 4DGL-uLCD-SE PinDetect SoftI2C
Diff: main.cpp
- Revision:
- 1:7d957da791a5
- Parent:
- 0:4c644bb83761
--- a/main.cpp Sun Apr 21 15:48:44 2019 +0000 +++ b/main.cpp Mon Apr 22 17:40:30 2019 +0000 @@ -201,7 +201,7 @@ } else if(gameState == RUNNING && !dead) { if(bullets > 0) { - IR.putc('0'); // change to xbeeId + IR.putc(xbeeId + '0'); // change to xbeeId bullets--; redraw_bullets(); sound_i = 0; @@ -332,6 +332,7 @@ case ENDED: gameState = ENDED; clear_footer(); + message_timeout.detach(); redraw_middle_message("Game Ended"); greenLED = 1; redLED = 0; @@ -444,6 +445,7 @@ } index++; } + shooteeName[nameIndex] = '\0'; if(shooterId == xbeeId) { char msg[80]; strcpy(msg, "You shot ");