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
Diff: main.cpp
- Revision:
- 5:cfec780c935b
- Parent:
- 4:d8bd8b41468d
- Child:
- 6:3be57cf4bd33
--- a/main.cpp Thu Oct 15 19:57:51 2015 +0000
+++ b/main.cpp Thu Oct 15 22:07:40 2015 +0000
@@ -16,24 +16,23 @@
uLCD.init();
pc.printf("Initialized...\n");
+
+ float theta = 0;
while(1) {
- uLCD.cls();
- uLCD.background_color(0xAB);
- uLCD.line(1,1,2,2, 0xAB);
- uLCD.circle(10,10,100, 0xAB);
- //uLCD.filled_circle(4,4,10, 0xAB);
- //uLCD.triangle(1,1, 2,2, 0,3, 0xAB);
- //uLCD.rectangle(0,0, 1,1, 0xAB);
- //uLCD.filled_rectangle(1,1, 2,2, 0xAB);
- //uLCD.pixel(40, 40, 0xAB);
- //uLCD.pen_size(4);
-
+ uLCD.line(64,64,64+50*cos(theta),64+50*sin(theta), BLACK);
+ theta += 0.05;
+ uLCD.line(64,64,64+50*cos(theta),64+50*sin(theta), RED);
+ uLCD.circle(10,10,100, GREEN);
+ uLCD.filled_circle(4,4,10, 0xAB);
+ uLCD.triangle(10,10, 20,20, 20,40, 0xAB);
+ uLCD.rectangle(100,100, 90,90, GREEN);
+ uLCD.filled_rectangle(100,100, 110,110, 0xAB);
+ uLCD.pixel(40, 40, WHITE);
uLCD.update();
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("Button State: %x %x %x %x %x\n", buttons[0], buttons[1], buttons[2], buttons[3], buttons[4]);
+ //pc.printf("\033[2J\033[0;0H");
}
}
\ No newline at end of file
