test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Committer:
kaku_jyoko
Date:
Fri Dec 16 13:52:36 2016 +0000
Revision:
63:4c22abbe4727
Parent:
59:6a99ec97eebd
remove led lump

Who changed what in which revision?

UserRevisionLine numberNew contents of line
th_mbed 2:50a76ed8bf55 1 #ifndef models_h
th_mbed 2:50a76ed8bf55 2 #define models_h
th_mbed 2:50a76ed8bf55 3
th_mbed 23:33d7efd62537 4 #include "point.h"
th_mbed 23:33d7efd62537 5 #include "mbed.h"
th_mbed 12:c74115744b24 6 //LCD params
th_mbed 12:c74115744b24 7 #define LCD_X 128
th_mbed 12:c74115744b24 8 #define LCD_Y 32
th_mbed 12:c74115744b24 9
th_mbed 12:c74115744b24 10 //Stage params
th_mbed 43:73afa890c336 11 #define ONE_STEP_SIZE 25
th_mbed 15:400760117d9d 12 //#define STEP_NUM LCD_X/ONE_STEP_SIZE+1
th_mbed 15:400760117d9d 13 #define ALL_LENGTH 1000 //stage all length
th_mbed 12:c74115744b24 14 #define STAGE_V 1
th_mbed 12:c74115744b24 15
th_mbed 9:a2195ad200fa 16 //Person params
th_mbed 12:c74115744b24 17 #define PERSON_SIZE 6 //person is 6 * 6 dots
th_mbed 2:50a76ed8bf55 18 #define DEFAULT_X 2
th_mbed 8:2fd3eedcde64 19 #define DEFAULT_Y 25 //31-7+1
kaku_jyoko 7:defdc7cb4e0b 20 #define MAX_JUMP_TIME 7
th_mbed 2:50a76ed8bf55 21 #define MAX_JUMP_COUNT 2
th_mbed 41:1a7c4d4d6bcd 22 #define JUMP_SIZE 2
th_mbed 8:2fd3eedcde64 23 #define GAME_OVER -1
th_mbed 2:50a76ed8bf55 24
th_mbed 9:a2195ad200fa 25 //Bullet params
th_mbed 31:17b4ee41bdc5 26 #define BULLET_SIZE 5 //bullet is 5*5
th_mbed 59:6a99ec97eebd 27 #define HIGH_SPEED 4
th_mbed 9:a2195ad200fa 28 #define NOMAL_SOEED 3
th_mbed 59:6a99ec97eebd 29 #define LOW_SPEED 2
th_mbed 59:6a99ec97eebd 30 #define HIGH 17
th_mbed 59:6a99ec97eebd 31 #define MIDDLE 12
th_mbed 59:6a99ec97eebd 32 #define LOW 7
th_mbed 9:a2195ad200fa 33
th_mbed 2:50a76ed8bf55 34 class Person
th_mbed 2:50a76ed8bf55 35 {
th_mbed 2:50a76ed8bf55 36 private:
th_mbed 2:50a76ed8bf55 37 point p;
th_mbed 2:50a76ed8bf55 38 int jump_count;
th_mbed 2:50a76ed8bf55 39 int jump_time;
th_mbed 8:2fd3eedcde64 40 bool isGround(int height);
th_mbed 2:50a76ed8bf55 41
th_mbed 2:50a76ed8bf55 42 public:
th_mbed 2:50a76ed8bf55 43 Person();
th_mbed 8:2fd3eedcde64 44 point update(int height);
th_mbed 2:50a76ed8bf55 45 point jump();
th_mbed 2:50a76ed8bf55 46 };
th_mbed 2:50a76ed8bf55 47
th_mbed 2:50a76ed8bf55 48 class Bullet
th_mbed 2:50a76ed8bf55 49 {
th_mbed 2:50a76ed8bf55 50 private:
th_mbed 2:50a76ed8bf55 51 point p;
th_mbed 2:50a76ed8bf55 52 int v;
th_mbed 2:50a76ed8bf55 53 public:
th_mbed 2:50a76ed8bf55 54 Bullet(point p, int v);
th_mbed 2:50a76ed8bf55 55 point update();
th_mbed 2:50a76ed8bf55 56 };
th_mbed 2:50a76ed8bf55 57
th_mbed 12:c74115744b24 58 class Stage
th_mbed 12:c74115744b24 59 {
th_mbed 12:c74115744b24 60 private:
th_mbed 12:c74115744b24 61 int length;
th_mbed 21:1911f2c4684b 62 int stage[LCD_X];
th_mbed 24:88968d1fc9cb 63 int nextStep();
th_mbed 12:c74115744b24 64 public:
th_mbed 21:1911f2c4684b 65 Stage();
th_mbed 21:1911f2c4684b 66 int* getStage();
th_mbed 21:1911f2c4684b 67 int getLength();
th_mbed 12:c74115744b24 68 };
th_mbed 12:c74115744b24 69
th_mbed 2:50a76ed8bf55 70 #endif