0
|
1 #include "bool.h"
|
|
2
|
|
3 #ifndef CHARACTER_h
|
|
4 #define CHARACTER_h 1
|
|
5
|
|
6 /*state id*/
|
|
7 #define ALIVE 0
|
|
8 #define EXPLODE 1
|
|
9 #define DELETE 2
|
|
10
|
|
11 /*group id*/
|
|
12 #define MYSHIP 0
|
|
13 #define MYBULLET 1
|
|
14 #define ENEMY 2
|
|
15 #define ENEMYBULLET 3
|
|
16
|
|
17 //typedef void (*STATE)(CHARACTER *p);
|
|
18
|
|
19 typedef struct enemy_status {
|
|
20 int charano; // sprite image number
|
|
21 int sc; // score
|
|
22 int p; // hardness
|
|
23 } table;
|
|
24
|
|
25
|
|
26 typedef struct CHARACTER{
|
|
27 float x; //position
|
|
28 float y;
|
|
29
|
|
30 float vx; //velocity
|
|
31 float vy;
|
|
32
|
|
33 float vit; //vitality
|
|
34 int score;
|
|
35 int dt1;
|
|
36 int dt2;
|
|
37 int charano; //sprite_number
|
|
38 BOOL tama; //bullet identifier
|
|
39 BOOL f; //apiarance idenfifier
|
|
40 float s;
|
|
41 //int group;
|
|
42
|
|
43 struct CHARACTER * (*state)(struct CHARACTER *p);
|
|
44 struct CHARACTER * (*collision)(struct CHARACTER *p);
|
|
45 //STATE state;
|
|
46 //STATE collision;
|
|
47 struct CHARACTER *next;
|
|
48 struct CHARACTER *prev;
|
|
49
|
|
50 } CHARACTER;
|
|
51
|
|
52
|
7
|
53 extern CHARACTER *active_chara_list;
|
|
54 extern CHARACTER *free_chara_list;
|
0
|
55 extern CHARACTER *kyeenemyno;
|
|
56 extern CHARACTER *tekino0;
|
|
57 extern CHARACTER *enemy_part1;
|
|
58 extern CHARACTER *enemy_part2;
|
|
59 extern CHARACTER *enemy_part3;
|
|
60 extern CHARACTER *enemy_part4;
|
|
61 extern CHARACTER *enemy_part5;
|
|
62
|
|
63 extern int filpcount;
|
|
64 extern int stage;
|
|
65 //extern teki enemy[300];
|
|
66 extern const table enemystate[50];
|
|
67
|
|
68 int init_chara_list(int num);
|
|
69 int extend_chara_list_pool(int num);
|
|
70 void TFon();
|
|
71 void TFoff();
|
|
72 void Putenemy(int charano, float x, float y, float vx, float vy,
|
|
73 CHARACTER * (*action)(CHARACTER *chara));
|
|
74 CHARACTER * delete_chara(CHARACTER *p);
|
|
75 void state_update();
|
|
76 void collision_detect();
|
|
77 void obj_draw();
|
|
78 void outofwindow();
|
|
79
|
|
80 #define ENEMY_STATUS(id,charno,score,hardness) {charno,score,hardness}
|
|
81
|
|
82 /**
|
|
83 * enemyの種類一覧
|
|
84 */
|
|
85 #define ENEMY_STATUS_TABLE {\
|
|
86 ENEMY_STATUS(UNUSED0, 0, 0, 0),\
|
|
87 ENEMY_STATUS(ID_GREENCRAB, ENEMY_GREENCRAB, 330, 98),\
|
|
88 ENEMY_STATUS(ID_PLANE, ENEMY_PLANE, 470, 37),\
|
|
89 ENEMY_STATUS(ID_REDBULLET, ENEMY_REDBULLET, 30, 16),\
|
|
90 ENEMY_STATUS(ID_BOSS1ORGAN, BOSS1_ORGAN, 25000, 10000),\
|
|
91 ENEMY_STATUS(ID_BOSS1SIDEPARTS, BOSS1_ORGAN, 10000, 10000),\
|
|
92 ENEMY_STATUS(ID_BLUEBULLET, ENEMY_BLUEBULLET, 40, 39),\
|
|
93 ENEMY_STATUS(ID_LASER, ENEMY_LASER, 100, 100000),\
|
|
94 ENEMY_STATUS(ID_LIGHTNING, ENEMY_LIGHTNING, 100, 100000),\
|
|
95 ENEMY_STATUS(ID_ASTEROID, ASTEROID, 170, 500),\
|
|
96 ENEMY_STATUS(ID_ASTEROIDID_BOSS2BODY, BOSS2_BODY, 100, 500),\
|
|
97 ENEMY_STATUS(ID_BOSS2LEFTSHOULDER, BOSS2_LEFTSHOULDER, 10000, 12000),\
|
|
98 ENEMY_STATUS(ID_BOSS2RIGHTSHOULDER, BOSS2_RIGHTSHOULDER, 10000, 12000),\
|
|
99 ENEMY_STATUS(ID_BOSS2RIGHTARM, BOSS2_RIGHTARM, 5000, 15000),\
|
|
100 ENEMY_STATUS(ID_BOSS2LEFTARM, BOSS2_LEFTARM, 5000, 15000),\
|
|
101 ENEMY_STATUS(ID_BOSS2BATTERY, BOSS2_BATTERY, 10000, 5000),\
|
|
102 ENEMY_STATUS(ID_BOSS2OPENBATTERY, BOSS2_OPENBATTERY, 10000, 5000),\
|
|
103 ENEMY_STATUS(ID_BOSS2BROKENHATCH, BOSS2_BROKENHATCH, 100, 500),\
|
|
104 ENEMY_STATUS(ID_BOSS2DUMMY, BOSS2_DUMMY, 50000, 15000),\
|
|
105 ENEMY_STATUS(ID_BOSS2RIGHTSHOULDERUP, BOSS2_RIGHTSHOULDERUP, 10000, 20000),\
|
|
106 ENEMY_STATUS(ID_BOSS2LEFTSHOULDERUP, BOSS2_LEFTSHOULDERUP, 10000, 15000),\
|
|
107 ENEMY_STATUS(ID_BOSS2LEFTSHOULDERGIRD, BOSS2_LEFTSHOULDERGIRD, 100, 20000),\
|
|
108 ENEMY_STATUS(ID_BOSS2RIGHTARMBATTERY, BOSS2_RIGHTARMBATTERY, 100, 500),\
|
|
109 ENEMY_STATUS(ID_BOSS2LEFTARMBATTERY, BOSS2_LEFTARMBATTERY, 100, 500),\
|
|
110 ENEMY_STATUS(ID_ORBIT, ORBITMACHINE, 20, 1000000),\
|
|
111 ENEMY_STATUS(UNUSED1, 0, 0, 0),\
|
|
112 ENEMY_STATUS(UNUSED2, 0, 0, 0),\
|
|
113 ENEMY_STATUS(UNUSED3, 0, 0, 0),\
|
|
114 ENEMY_STATUS(UNUSED4, 0, 0, 0),\
|
|
115 ENEMY_STATUS(UNUSED5, 0, 0, 0),\
|
|
116 ENEMY_STATUS(ID_BLACK_HOLE, BLACKHOLE, 200000, 30000),\
|
|
117 ENEMY_STATUS(UNUSED6, 0, 0, 0),\
|
|
118 ENEMY_STATUS(UNUSED7, 0, 0, 0),\
|
|
119 ENEMY_STATUS(UNUSED8, 0, 0, 0),\
|
|
120 ENEMY_STATUS(UNUSED9, 0, 0, 0),\
|
|
121 ENEMY_STATUS(UNUSED10, 0, 0, 0),\
|
|
122 ENEMY_STATUS(UNUSED11, 0, 0, 0),\
|
|
123 ENEMY_STATUS(UNUSED12, 0, 0, 0),\
|
|
124 ENEMY_STATUS(UNUSED13, 0, 0, 0),\
|
|
125 ENEMY_STATUS(UNUSED14, 0, 0, 0),\
|
|
126 ENEMY_STATUS(ID_GUN_BATTERY, GUNBATTERY, 540, 137),\
|
|
127 ENEMY_STATUS(ID_PURPLE_CORE, PURPLECORE, 840, 287),\
|
|
128 ENEMY_STATUS(ID_SPACE_FISH, SPACEFISH, 370, 137),\
|
|
129 ENEMY_STATUS(ID_AUTOMISSILE, MISSILE, 210, 24),\
|
|
130 ENEMY_STATUS(ID_BOSS3, BOSS3_BODY, 100000, 9600),\
|
|
131 ENEMY_STATUS(UNUSED15, 0, 0, 0),\
|
|
132 ENEMY_STATUS(UNUSED16, 0, 0, 0),\
|
|
133 ENEMY_STATUS(UNUSED17, 0, 0, 0),\
|
|
134 ENEMY_STATUS(UNUSED18, 0, 0, 0),\
|
|
135 ENEMY_STATUS(ID_BOSS4, BODD4_BODY, 300000, 20400)\
|
|
136 }
|
|
137
|
|
138 //#define ENEMY_STATUS(id,charno,score,hardness) id
|
|
139 //typedef enum ENEMY_STATUS EnemyId;
|
|
140 #endif
|