test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
Revision 32:abb3086c210d, committed 2016-12-12
- Comitter:
- kaku_jyoko
- Date:
- Mon Dec 12 11:48:19 2016 +0000
- Parent:
- 30:f26dcbaa946d
- Child:
- 33:442498e281b1
- Commit message:
- convert
Changed in this revision
--- a/KakuGraphicBuilder.cpp Mon Dec 12 11:17:22 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -#include "kaku_integrate.h" -#include "models.h" -#include "graphics.h" - -char map = {0x00}; - - -KakuGraphicBuilder::KakuGraphicBuilder() -{ - Bitmap b = { - LCD_X, - LCD_Y, - LCD_X / 8, - map, - }; - bitmap_all = b; - reset_white_board(); -} - -Bitmap KakuGraphicBuilder::integrateBitmap(point pe, point bu, point st[]) -{ - Bitmap b; - return b; - -} - -void KakuGraphicBuilder::convolution(point p, int width, int height) -{ - -} - -void KakuGraphicBuilder::reset_white_board() -{ - for(int i = 0; i < LCD_Y; i++){ - for (int j = 0; j < LCD_X; j++){ - white_board[i][j] = 0; - } - } -} - -void intToBitmap(){ - for(int i = 0; i < LCD_Y ; i++){ - for (int j = 1; j <= LCD_X / 8; j++){ - - } - } -} - -
--- a/kaku_integrate.h Mon Dec 12 11:17:22 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#ifndef kaku_integrate_H -#define kaku_integrate_H -#include "C12832_lcd.h" -#include "models.h" - - -class KakuGraphicBuilder -{ -private: - point pe; - point bu; - point st[]; - char map[(LCD_X / 8) * LCD_Y]; - Bitmap bitmap_all; - - void convolution(point p, int width, int heigth); - - void intToBitmap(); - - int white_board[LCD_Y][LCD_X]; - - void reset_white_board(); - -public: - Bitmap integrateBitmap(point pe, point bu, point st[]); - KakuGraphicBuilder(); -}; - -#endif \ No newline at end of file
--- 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);