test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Files at this revision

API Documentation at this revision

Comitter:
th_mbed
Date:
Wed Dec 14 10:53:38 2016 +0000
Parent:
58:3f1b71a9318c
Child:
60:d04bc5987d53
Commit message:
refactor code using macro

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
models.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Dec 14 06:13:33 2016 +0000
+++ b/main.cpp	Wed Dec 14 10:53:38 2016 +0000
@@ -63,15 +63,15 @@
 
 void bullet_receive(void const *argument){
     //bullet option
-    int fast = 4;
-    int normal = 3;
-    int slow = 2;
-    int high = 17;
-    int middle = 12;
-    int low = 7;
+    int fast = HIGH_SPEED;
+    int normal = NOMAL_SOEED;
+    int slow = LOW_SPEED;
+    int high = HIGH;
+    int middle = MIDDLE;
+    int low = LOW;
 
     point start;
-    start.x = 127;
+    start.x = LCD_X - 1;
     char c;
     while(true){
         t.start();
--- a/models.h	Wed Dec 14 06:13:33 2016 +0000
+++ b/models.h	Wed Dec 14 10:53:38 2016 +0000
@@ -24,9 +24,12 @@
 
 //Bullet params
 #define BULLET_SIZE 5 //bullet is 5*5
-#define HIGH_SPEED 5
+#define HIGH_SPEED 4
 #define NOMAL_SOEED 3
-#define LOW_SPEED 1
+#define LOW_SPEED 2
+#define HIGH 17
+#define MIDDLE 12
+#define LOW 7
 
 class Person
 {