![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
Diff: main.cpp
- Revision:
- 32:abb3086c210d
- Parent:
- 29:7784b098ef1d
- Child:
- 33:442498e281b1
--- a/main.cpp Mon Dec 12 11:17:22 2016 +0000 +++ b/main.cpp Mon Dec 12 11:48:19 2016 +0000 @@ -7,6 +7,7 @@ #include "rtos.h" #include "point.h" #include "stdlib.h" +#include "convert.h" C12832_LCD lcd; @@ -23,7 +24,6 @@ Serial pc(USBTX, USBRX); // tx, rx Bullet* b = NULL; Timer t; -char picture[(LCD_X / 8 + 1) * LCD_Y]; int white_board[LCD_Y][LCD_X]; int* wall_height; @@ -80,7 +80,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); if((p_person.x + 2 >= p_bullet.x) && (p_person.x + 2 <= p_bullet.x + 5)){ - printf("aaaaa"); + printf("aaaaa\n"); if((p_person.y + 2 >= p_bullet.y + 1) && (p_person.y + 2 <= p_bullet.y + 4)){ printf("gameover\n"); } @@ -96,6 +96,9 @@ lcd.setmode(XOR); int gameOver = 0; srand((int)(aIn * 100)); + Converter converter(); +// Bitmap picture; + while(true){ update_mtx.lock(); reset_white_board(); @@ -107,6 +110,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); corrision_judge(p_person, p_bullet); + Bitmap picture = converter.convert(white_board); update_mtx.unlock(); lcd.cls(); lcd.print_bm(bitmPlayer,p_person.x,p_person.y);