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 14:22:27 2016 +0000
Parent:
43:73afa890c336
Parent:
48:7d51d641074f
Child:
50:d8a6e8ddd63a
Commit message:
???;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Dec 13 14:14:50 2016 +0000
+++ b/main.cpp	Tue Dec 13 14:22:27 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();