![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
models.h@9:a2195ad200fa, 2016-12-05 (annotated)
- Committer:
- th_mbed
- Date:
- Mon Dec 05 08:12:13 2016 +0000
- Revision:
- 9:a2195ad200fa
- Parent:
- 8:2fd3eedcde64
- Child:
- 12:c74115744b24
add Bullet params
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kaku_jyoko | 4:0fe59e58def9 | 1 | #include "point.h" |
th_mbed | 2:50a76ed8bf55 | 2 | #ifndef models_h |
th_mbed | 2:50a76ed8bf55 | 3 | #define models_h |
th_mbed | 2:50a76ed8bf55 | 4 | |
th_mbed | 9:a2195ad200fa | 5 | //Person params |
th_mbed | 2:50a76ed8bf55 | 6 | #define DEFAULT_X 2 |
th_mbed | 8:2fd3eedcde64 | 7 | #define DEFAULT_Y 25 //31-7+1 |
kaku_jyoko | 7:defdc7cb4e0b | 8 | #define MAX_JUMP_TIME 7 |
th_mbed | 2:50a76ed8bf55 | 9 | #define MAX_JUMP_COUNT 2 |
th_mbed | 8:2fd3eedcde64 | 10 | #define JUMP_SIZE 2 |
th_mbed | 8:2fd3eedcde64 | 11 | #define GAME_OVER -1 |
th_mbed | 2:50a76ed8bf55 | 12 | |
th_mbed | 9:a2195ad200fa | 13 | //Bullet params |
th_mbed | 9:a2195ad200fa | 14 | #define HIGH_SPEED 5 |
th_mbed | 9:a2195ad200fa | 15 | #define NOMAL_SOEED 3 |
th_mbed | 9:a2195ad200fa | 16 | #define LOW_SPEED 1 |
th_mbed | 9:a2195ad200fa | 17 | |
th_mbed | 2:50a76ed8bf55 | 18 | class Person |
th_mbed | 2:50a76ed8bf55 | 19 | { |
th_mbed | 2:50a76ed8bf55 | 20 | private: |
th_mbed | 2:50a76ed8bf55 | 21 | point p; |
th_mbed | 2:50a76ed8bf55 | 22 | int jump_count; |
th_mbed | 2:50a76ed8bf55 | 23 | int jump_time; |
th_mbed | 8:2fd3eedcde64 | 24 | bool isGround(int height); |
th_mbed | 2:50a76ed8bf55 | 25 | |
th_mbed | 2:50a76ed8bf55 | 26 | public: |
th_mbed | 2:50a76ed8bf55 | 27 | Person(); |
th_mbed | 8:2fd3eedcde64 | 28 | point update(int height); |
th_mbed | 2:50a76ed8bf55 | 29 | point jump(); |
th_mbed | 2:50a76ed8bf55 | 30 | }; |
th_mbed | 2:50a76ed8bf55 | 31 | |
th_mbed | 2:50a76ed8bf55 | 32 | class Bullet |
th_mbed | 2:50a76ed8bf55 | 33 | { |
th_mbed | 2:50a76ed8bf55 | 34 | private: |
th_mbed | 2:50a76ed8bf55 | 35 | point p; |
th_mbed | 2:50a76ed8bf55 | 36 | int v; |
th_mbed | 2:50a76ed8bf55 | 37 | public: |
th_mbed | 2:50a76ed8bf55 | 38 | Bullet(point p, int v); |
th_mbed | 2:50a76ed8bf55 | 39 | point update(); |
th_mbed | 2:50a76ed8bf55 | 40 | }; |
th_mbed | 2:50a76ed8bf55 | 41 | |
th_mbed | 2:50a76ed8bf55 | 42 | #endif |