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:
Tue Dec 13 13:54:57 2016 +0000
Parent:
41:1a7c4d4d6bcd
Parent:
45:7d0a58fbaa8b
Child:
47:50c54cb24316
Commit message:
aa

Changed in this revision

--- a/main.cpp	Tue Dec 13 13:48:36 2016 +0000
+++ b/main.cpp	Tue Dec 13 13:54:57 2016 +0000
@@ -101,6 +101,15 @@
     return false;
 }
 
+bool wall_collision(point p_person){
+    int x = p_person.x + 5;
+    int y = p_person.y + 6;
+    if(wall_height[x - 1] > (LCD_Y - y)){
+        return true;
+    }
+    return false;
+}
+
 int main(){
     point p_person, p_bullet;
     printf("hello\n");
@@ -126,6 +135,7 @@
             //printf("bullet  x: %d,  y: %d \n", p_bullet.x,p_bullet.y);
             //printf("person  x: %d,  y: %d \n", p_person.x,p_person.y);
             gameover = bullet_collision(p_person, p_bullet);
+            gameover = wall_collision(p_person);
             picture = converter.convert(white_board);
             update_mtx.unlock();