test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
Diff: main.cpp
- Revision:
- 49:726ebd187f75
- Parent:
- 47:50c54cb24316
- Child:
- 54:64c0bdcc94ae
--- 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();