test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Files at this revision

API Documentation at this revision

Comitter:
kaku_jyoko
Date:
Wed Dec 14 06:13:33 2016 +0000
Parent:
57:873b89862cfb
Child:
59:6a99ec97eebd
Commit message:
aaa

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Dec 14 03:29:19 2016 +0000
+++ b/main.cpp	Wed Dec 14 06:13:33 2016 +0000
@@ -154,7 +154,7 @@
 
 bool wall_collision(point p_person){
     //壁衝突判定と穴落ち判定
-    int x = p_person.x + 5;
+    int x = p_person.x + 4;
     int y = p_person.y + 6;
     if(wall_height[x - 1] > (LCD_Y - y)){
         return true;
@@ -172,6 +172,7 @@
     srand((int)(aIn * 100));
     Converter converter;
     Bitmap picture;
+    printf("New Game Start\n");
     printf("Bullet Option\n");
     printf("       slow    normal  fast\n");
     printf("high     1       2       3\n");
@@ -180,9 +181,9 @@
     
     while(true){
         if(!gameover){
-            update_mtx.lock();
             reset_white_board();
             make_wall();
+            update_mtx.lock();
             p_person = h.update(wall_height[3]);
             //p_person = h.update(1);
             if(b != NULL){
@@ -190,9 +191,10 @@
             }
             picture = converter.convert(white_board);
             
+            update_mtx.unlock();
+            
             gameover |= bullet_collision(p_person, p_bullet);
             gameover |= wall_collision(p_person);
-            update_mtx.unlock();
             
             lcd.cls();
             lcd.print_bm(bitmPlayer,p_person.x,p_person.y);