The classic dueling tanks game for mbed.
Dependencies: 4DGL-uLCD-SE DRV2605 EthernetInterface Game_Synchronizer MMA8452 SDFileSystem SparkfunAnalogJoystick mbed-rtos mbed wave_player
Fork of 2035_Tanks_Shell by
Revision 4:d8bd8b41468d, committed 2015-10-15
- Comitter:
- jford38
- Date:
- Thu Oct 15 19:57:51 2015 +0000
- Parent:
- 3:3ddefff03cb2
- Child:
- 5:cfec780c935b
- Commit message:
- Working without LCD's. Going to add uLCD's now.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
two_player.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Oct 12 08:20:31 2015 +0000 +++ b/main.cpp Thu Oct 15 19:57:51 2015 +0000 @@ -34,6 +34,6 @@ buttons = uLCD.get_button_state(); pc.printf("Button State: %x %x %x %x %x\n", buttons[0], buttons[1], buttons[2], buttons[3], buttons[4]); wait(1); - //pc.printf("\033[2J\033[0;0H"); + pc.printf("\033[2J\033[0;0H"); } } \ No newline at end of file
--- a/two_player.h Mon Oct 12 08:20:31 2015 +0000 +++ b/two_player.h Thu Oct 15 19:57:51 2015 +0000 @@ -26,7 +26,7 @@ enum Color { - CLS_CMD, + CLS_CMD=1, BG_COLOR_CMD, LINE_CMD, CIRCLE_CMD, @@ -160,7 +160,8 @@ sock->send_all((char*)buttons, sizeof(buttons)); } - int i = 0; + int i = 0; + pc.printf("Buffer: "); while(buffer[i] != '\0') { pc.printf("%d ", buffer[i]); i++; @@ -189,7 +190,7 @@ case CIRCLE_CMD: //LCD->cls(); pc.printf("CIRCLE: (%d, %d), r=%d\n", buffer[idx], buffer[idx+1], buffer[idx+2]); - idx += 3; + idx += 4; break; default: pc.printf("UNKNOWN CMD %d: This could get ugly!\n", cmd);