Schussphysik: Schwung des Spielers mit einrechnen, Schüsse auf LCD sichtbarer.
[hackover2013-badge-firmware.git] / badge / jumpnrun / enemies.c
1 #include "enemies.h"
2
3 #include "collision.h"
4 #include "tiles.h"
5 #include "jumpnrun.h"
6
7 static badge_sprite const anim_cat[] = {
8 { 8, 5, (uint8_t const *) "\xc7\x3f\xce\x38\x11" },
9 { 8, 5, (uint8_t const *) "\xd7\x7d\xc6\x19\x25" }
10 };
11
12 static badge_sprite const anim_mushroom[] = {
13 { 7, 7, (uint8_t const *) "\x10\x0c\x9f\xcf\xc7\x40" },
14 { 7, 7, (uint8_t const *) "\x20\x18\x1e\x8f\x87\x81" },
15 { 7, 7, (uint8_t const *) "\x10\x0c\x9f\xcf\xc7\x40" },
16 { 7, 7, (uint8_t const *) "\x08\x86\xdf\xef\x67\x20" },
17 { 7, 7, (uint8_t const *) "\x04\xc3\xef\xf7\x33\x10" },
18 { 7, 7, (uint8_t const *) "\x04\xc3\xe7\xf3\x31\x10" }
19 };
20
21 static badge_sprite const anim_bunny[] = {
22 { 7, 5, (uint8_t const *) "\x60\x30\xbe\x31\x02" },
23 { 7, 5, (uint8_t const *) "\x42\x30\xbe\x31\x01" },
24 { 7, 5, (uint8_t const *) "\x42\x30\xae\x35\x01" },
25 { 7, 5, (uint8_t const *) "\x60\x30\xae\x35\x02" },
26 { 7, 5, (uint8_t const *) "\x60\x30\xbe\x31\x01" }
27 };
28
29 static badge_sprite const anim_snake[] = {
30 { 10, 6, (uint8_t const *) "\x10\x86\x83\x30\x04\x83\xa2\x07" },
31 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x0c\xc1\xa2\x07" },
32 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x08\x82\xe0\x07" },
33 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x08\x86\xe1\x07" }
34 };
35
36 static badge_sprite const anim_spiral[] = {
37 { 10, 10, (uint8_t const *) "\xff\x07\xd8\x6f\xa1\xb5\xf6\x1a\xe8\xbf\x00\xfe\x0f" },
38 { 10, 10, (uint8_t const *) "\xff\x07\xd8\x6f\xa1\xb5\xd6\xda\x69\xb0\x7f\x02\x0c" },
39 { 10, 10, (uint8_t const *) "\xff\x07\xd8\x6f\xa1\xb5\xd6\x5a\x6a\xaf\x81\xfe\x0b" },
40 { 10, 10, (uint8_t const *) "\xff\x07\xd8\x4f\x61\x35\xd5\x55\x54\x5f\x01\xfd\x07" },
41 { 10, 10, (uint8_t const *) "\xff\x07\xd0\x7f\x81\xf5\xd6\x5a\x68\xbf\x01\xfe\x0f" },
42 { 10, 10, (uint8_t const *) "\x03\xe4\xdf\x60\xb9\xb5\xd6\x5a\x68\xbf\x01\xfe\x0f" },
43 { 10, 10, (uint8_t const *) "\xfd\x17\x58\x6f\xa5\xb5\xd6\x5a\x68\xbf\x01\xfe\x0f" },
44 { 10, 10, (uint8_t const *) "\xfe\x0b\xa8\xaf\xa2\xba\xca\x6a\x28\xbf\x01\xfe\x0f" }
45 };
46
47 static badge_sprite const anim_rotor[] = {
48 { 9, 9, (uint8_t const *) "\x00\x00\x00\x00\xf0\xe1\x42\x0c\x18\x70\x00" },
49 { 9, 9, (uint8_t const *) "\x1c\x30\x60\x80\xf0\xe1\x40\x00\x00\x00\x00" },
50 { 9, 9, (uint8_t const *) "\x1c\x30\x60\x84\x0e\x1f\x00\x00\x00\x00\x00" },
51 { 9, 9, (uint8_t const *) "\x00\x00\x00\x04\x0e\x1f\x02\x0c\x18\x70\x00" }
52 };
53
54 static badge_sprite const anim_dog[] = {
55 { 8, 5, (uint8_t const *) "\xc1\xf8\xc6\xb8\x08" },
56 { 8, 5, (uint8_t const *) "\xc1\xba\xce\x99\x0c" },
57 { 8, 5, (uint8_t const *) "\xc1\xf8\xc6\xb8\x10" },
58 { 8, 5, (uint8_t const *) "\xc1\xf8\xc6\xb8\x20" }
59 };
60
61 static badge_sprite const anim_giraffe[] = {
62 { 8, 10, (uint8_t const *) "\x00\x10\x60\x80\xff\xc1\x00\x03\x3c\x08" },
63 { 8, 10, (uint8_t const *) "\x00\x10\x60\xa0\x7f\xc1\x00\x03\x1c\x88" },
64 { 9, 10, (uint8_t const *) "\x00\x10\x68\x90\x3f\xc1\x00\x03\x0c\x48\x00\x02" },
65 { 8, 10, (uint8_t const *) "\x00\x10\x60\xb0\x3f\xc1\x00\x03\x0c\xc8" },
66 { 8, 10, (uint8_t const *) "\x08\x30\xc0\x81\xfc\xc0\x00\x03\x3c\x08" },
67 { 8, 10, (uint8_t const *) "\x00\x10\x60\x80\xff\xc1\x00\x03\x3c\x08" }
68 };
69
70 static badge_sprite const anim_bird[] = {
71 { 9, 7, (uint8_t const *) "\x10\x0c\x05\xf7\x4a\xa9\x58\x10" },
72 { 9, 7, (uint8_t const *) "\x10\x0c\x05\x87\x47\xa2\x70\x10" }
73 /*
74 { 10, 8, (uint8_t const *) "\x10\x10\x18\x14\x38\x2e\x29\x29\x2e\x10" },
75 { 10, 8, (uint8_t const *) "\x10\x10\x18\x14\x38\x78\xa8\xa8\x78\x10" }
76 */
77 };
78
79 static void enemy_animation_advance(jumpnrun_enemy *enemy) {
80 ++enemy->base.tick_minor;
81 if(enemy->base.tick_minor == enemy->type->animation_ticks_per_frame) {
82 enemy->base.tick_minor = 0;
83
84 ++enemy->base.anim_frame;
85 if(enemy->base.anim_frame >= enemy->type->animation_length) {
86 enemy->base.anim_frame = 0;
87 }
88 }
89 }
90
91 void jumpnrun_process_enemy(jumpnrun_enemy *self,
92 badge_framebuffer *fb,
93 struct jumpnrun_game_state *state,
94 struct jumpnrun_level *lv,
95 struct jumpnrun_tile_range const *visible_tiles,
96 vec2d *player_inertia_mod) {
97 int const spawn_margin = 1 + self->type->animation_frames[self->base.anim_frame].width;
98
99 if(self->flags & JUMPNRUN_ENEMY_SPAWNED) {
100 if(fixed_point_lt(rectangle_left(enemy_box(self)), FIXED_POINT(state->left - spawn_margin, 0)) ||
101 fixed_point_gt(rectangle_left(enemy_box(self)), FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH + spawn_margin, 0)) ||
102 fixed_point_gt(rectangle_top (enemy_box(self)), FIXED_POINT(BADGE_DISPLAY_HEIGHT , 0))) {
103 self->flags &= ~JUMPNRUN_ENEMY_SPAWNED;
104 } else {
105 self->type->move_tick(self, state, lv, visible_tiles, player_inertia_mod);
106 self->type->collision_shots(self, state);
107
108 if(fb) {
109 badge_framebuffer_blt(fb,
110 fixed_point_cast_int(rectangle_left(enemy_box(self))) - state->left,
111 fixed_point_cast_int(rectangle_top (enemy_box(self))),
112 enemy_sprite(self),
113 enemy_render_flags(self));
114 }
115 }
116 } else if(self->flags & JUMPNRUN_ENEMY_UNAVAILABLE) {
117 if(state->left > fixed_point_cast_int(self->spawn_pos.x) + spawn_margin ||
118 state->left + BADGE_DISPLAY_WIDTH + spawn_margin < fixed_point_cast_int(self->spawn_pos.x)) {
119 self->flags &= ~JUMPNRUN_ENEMY_UNAVAILABLE;
120 }
121 } else if((fixed_point_gt(self->spawn_pos.x, FIXED_POINT(state->left - spawn_margin, 0)) &&
122 fixed_point_lt(self->spawn_pos.x, FIXED_POINT(state->left - spawn_margin / 2, 0))) ||
123 (fixed_point_lt(self->spawn_pos.x, FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH + spawn_margin, 0)) &&
124 fixed_point_gt(self->spawn_pos.x, FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH, 0)))) {
125 // enemy unspawned, available and in spawn zone.
126 self->flags |= JUMPNRUN_ENEMY_SPAWNED | JUMPNRUN_ENEMY_UNAVAILABLE;
127 self->base.current_box = rectangle_new(self->spawn_pos, self->type->extent);
128 self->base.inertia = self->type->spawn_inertia;
129 self->base.anim_frame = 0;
130 self->base.tick_minor = 0;
131 self->base.touching_ground = false;
132 self->base.jumpable_frames = 0;
133 }
134 }
135
136 void enemy_collision_tiles_bounce_horiz(jumpnrun_enemy *self,
137 vec2d *desired_position,
138 jumpnrun_level *lv,
139 jumpnrun_tile_range const *visible_tiles) {
140 vec2d inertia_mod = self->base.inertia;
141
142 collisions_tiles_displace(desired_position,
143 &self->base,
144 lv,
145 visible_tiles,
146 &inertia_mod);
147
148 if(fixed_point_ne(inertia_mod.x, self->base.inertia.x)) {
149 self->base.inertia.x = fixed_point_neg(self->base.inertia.x);
150 }
151 }
152
153 void enemy_collision_player_deadly(struct jumpnrun_enemy *self,
154 struct jumpnrun_game_state *state,
155 vec2d *player_inertia_mod) {
156 (void) player_inertia_mod;
157
158 rectangle rect_self = enemy_hitbox(self);
159
160 if(rectangle_intersect(&rect_self, &state->player.current_box)) {
161 state->status = JUMPNRUN_DEAD;
162 }
163 }
164
165 void enemy_collision_player_jumpable(jumpnrun_enemy *self,
166 jumpnrun_game_state *state,
167 vec2d *player_inertia_mod)
168 {
169 rectangle rect_self = enemy_hitbox(self);
170
171 if(rectangle_intersect(&rect_self, &state->player.current_box)) {
172 if(fixed_point_lt(rectangle_top(&state->player.current_box), rectangle_top(&rect_self)) &&
173 fixed_point_gt(state->player.inertia.y, FIXED_POINT(0, 0)))
174 {
175 self->flags &= ~JUMPNRUN_ENEMY_SPAWNED;
176 player_inertia_mod->y = FIXED_POINT(0, -250);
177 state->player.jumpable_frames = 12;
178 } else {
179 state->status = JUMPNRUN_DEAD;
180 }
181 }
182 }
183
184 void enemy_collision_tiles_pass_through(struct jumpnrun_enemy *self,
185 vec2d *desired_position,
186 struct jumpnrun_level *lv,
187 struct jumpnrun_tile_range const *visible_tiles) {
188 (void) self;
189 (void) desired_position;
190 (void) lv;
191 (void) visible_tiles;
192 return;
193 }
194
195 void enemy_collision_shots_die(struct jumpnrun_enemy *self,
196 struct jumpnrun_game_state *state) {
197 rectangle rect_self = enemy_hitbox(self);
198
199 for(uint8_t i = 0; i < JUMPNRUN_MAX_SHOTS; ++i) {
200 jumpnrun_shot *shot = &state->shots[i];
201
202 if(jumpnrun_shot_spawned(shot)) {
203 if(rectangle_intersect(&rect_self, &shot->current_box)) {
204 self->flags &= ~JUMPNRUN_ENEMY_SPAWNED;
205 jumpnrun_shot_despawn(shot);
206 }
207 }
208 }
209 }
210
211 void enemy_collision_shots_bounce(struct jumpnrun_enemy *self,
212 struct jumpnrun_game_state *state) {
213 rectangle rect_self = enemy_hitbox(self);
214
215 for(uint8_t i = 0; i < JUMPNRUN_MAX_SHOTS; ++i) {
216 jumpnrun_shot *shot = &state->shots[i];
217
218 if(jumpnrun_shot_spawned(shot)) {
219 if(rectangle_intersect(&rect_self, &shot->current_box)) {
220 if(fixed_point_gt(shot->inertia.x, FIXED_INT(0))) {
221 rectangle_move_to_x(&shot->current_box, fixed_point_sub(rectangle_left(&rect_self), rectangle_width(&shot->current_box)));
222 } else {
223 rectangle_move_to_x(&shot->current_box, rectangle_right(&rect_self));
224 }
225
226 shot->inertia.x = fixed_point_neg(shot->inertia.x);
227 }
228 }
229 }
230 }
231
232 void enemy_collision_shots_dontcare(struct jumpnrun_enemy *self,
233 struct jumpnrun_game_state *state) {
234 (void) self;
235 (void) state;
236 }
237
238 void enemy_tick_straight_ahead(jumpnrun_enemy *self,
239 jumpnrun_game_state *state,
240 jumpnrun_level *lv,
241 jumpnrun_tile_range const *visible_tiles,
242 vec2d *player_inertia_mod) {
243 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
244
245 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
246 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
247 return;
248 }
249
250 jumpnrun_passive_movement(&self->base.inertia);
251
252 vec2d new_pos = vec2d_add(enemy_position(self), self->base.inertia);
253 self->type->collision_tiles(self, &new_pos, lv, visible_tiles);
254 self->type->collision_player(self, state, player_inertia_mod);
255 rectangle_move_to(&self->base.current_box, new_pos);
256
257 enemy_animation_advance(self);
258 }
259
260 void enemy_tick_swing_up_and_down(struct jumpnrun_enemy *self,
261 struct jumpnrun_game_state *state,
262 struct jumpnrun_level *lv,
263 struct jumpnrun_tile_range const *visible_tiles,
264 vec2d *player_inertia_mod) {
265 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
266
267 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
268 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
269 return;
270 }
271
272 vec2d new_pos = vec2d_add(enemy_position(self), self->base.inertia);
273 self->type->collision_tiles(self, &new_pos, lv, visible_tiles);
274 self->type->collision_player(self, state, player_inertia_mod);
275 rectangle_move_to(&self->base.current_box, new_pos);
276
277 self->base.inertia.y =
278 fixed_point_add(fixed_point_add(self->base.inertia.y,
279 fixed_point_div(self->type->spawn_inertia.y, FIXED_INT(3))),
280 fixed_point_mul(FIXED_POINT(0, 5),
281 fixed_point_sub(self->spawn_pos.y,
282 enemy_position(self).y)));
283
284 enemy_animation_advance(self);
285 }
286
287 void enemy_tick_stationary(struct jumpnrun_enemy *self,
288 struct jumpnrun_game_state *state,
289 struct jumpnrun_level *lv,
290 struct jumpnrun_tile_range const *visible_tiles,
291 vec2d *player_inertia_mod) {
292 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
293
294 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
295 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
296 return;
297 }
298
299 self->type->collision_tiles(self, &self->base.current_box.pos, lv, visible_tiles);
300 self->type->collision_player(self, state, player_inertia_mod);
301
302 enemy_animation_advance(self);
303 }
304
305 void enemy_tick_jumper(jumpnrun_enemy *self,
306 jumpnrun_game_state *state,
307 jumpnrun_level *lv,
308 jumpnrun_tile_range const *visible_tiles,
309 vec2d *player_inertia_mod) {
310 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
311
312 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
313 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
314 return;
315 }
316
317 jumpnrun_passive_movement(&self->base.inertia);
318
319 vec2d new_pos = vec2d_add(enemy_position(self), self->base.inertia);
320 self->type->collision_tiles(self, &new_pos, lv, visible_tiles);
321 self->type->collision_player(self, state, player_inertia_mod);
322 rectangle_move_to(&self->base.current_box, new_pos);
323
324 if(self->base.touching_ground) {
325 self->base.inertia.y = self->type->spawn_inertia.y;
326 }
327
328 enemy_animation_advance(self);
329 }
330
331 void enemy_tick_dog(jumpnrun_enemy *self,
332 jumpnrun_game_state *state,
333 jumpnrun_level *lv,
334 jumpnrun_tile_range const *visible_tiles,
335 vec2d *player_inertia_mod) {
336 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
337
338 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
339 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
340 return;
341 }
342
343 jumpnrun_passive_movement(&self->base.inertia);
344
345 vec2d new_pos = vec2d_add(enemy_position(self), self->base.inertia);
346 self->type->collision_tiles(self, &new_pos, lv, visible_tiles);
347 self->type->collision_player(self, state, player_inertia_mod);
348 rectangle_move_to(&self->base.current_box, new_pos);
349
350 if(self->base.tick_minor % self->type->animation_ticks_per_frame == 0) {
351 switch(self->base.tick_minor / self->type->animation_ticks_per_frame) {
352 case 12:
353 self->base.tick_minor = 0;
354 case 0:
355 case 2:
356 case 4:
357 case 6:
358 self->base.anim_frame = 0;
359 if(self->flags & JUMPNRUN_ENEMY_FACING_RIGHT) {
360 self->base.inertia.x = fixed_point_neg(self->type->spawn_inertia.x);
361 } else {
362 self->base.inertia.x = self->type->spawn_inertia.x;
363 }
364
365 break;
366
367 case 1:
368 case 3:
369 case 5:
370 case 7:
371 self->base.anim_frame = 1;
372 if(self->flags & JUMPNRUN_ENEMY_FACING_RIGHT) {
373 self->base.inertia.x = fixed_point_neg(self->type->spawn_inertia.x);
374 } else {
375 self->base.inertia.x = self->type->spawn_inertia.x;
376 }
377 break;
378
379 case 8:
380 case 10:
381 self->base.anim_frame = 2;
382 self->base.inertia.x = FIXED_INT(0);
383 break;
384
385 case 9:
386 case 11:
387 self->base.anim_frame = 3;
388 self->base.inertia.x = FIXED_INT(0);
389 break;
390 }
391 }
392
393 ++self->base.tick_minor;
394 if (fixed_point_lt(self->base.inertia.x, FIXED_INT(0))) { self->flags &= ~JUMPNRUN_ENEMY_FACING_RIGHT; }
395 else if(fixed_point_ne(self->base.inertia.x, FIXED_INT(0))) { self->flags |= JUMPNRUN_ENEMY_FACING_RIGHT; }
396 }
397
398 void enemy_tick_giraffe(jumpnrun_enemy *self,
399 jumpnrun_game_state *state,
400 jumpnrun_level *lv,
401 jumpnrun_tile_range const *visible_tiles,
402 vec2d *player_inertia_mod) {
403 int screenpos = fixed_point_cast_int(rectangle_left(&self->base.current_box));
404
405 if(screenpos + JUMPNRUN_MAX_SPAWN_MARGIN < state->left ||
406 screenpos >= state->left + BADGE_DISPLAY_WIDTH + JUMPNRUN_MAX_SPAWN_MARGIN) {
407 return;
408 }
409
410 bool was_on_ground = self->base.touching_ground;
411
412 jumpnrun_passive_movement(&self->base.inertia);
413
414 vec2d new_pos = vec2d_add(enemy_position(self), self->base.inertia);
415 self->type->collision_tiles(self, &new_pos, lv, visible_tiles);
416 self->type->collision_player(self, state, player_inertia_mod);
417 rectangle_move_to(&self->base.current_box, new_pos);
418
419 if(self->base.touching_ground) {
420 if(was_on_ground) {
421 enemy_animation_advance(self);
422 if(self->base.anim_frame == 0) {
423 if(self->flags & JUMPNRUN_ENEMY_FACING_RIGHT) {
424 self->base.inertia.x = fixed_point_neg(self->type->spawn_inertia.x);
425 self->base.inertia.y = self->type->spawn_inertia.y;
426 } else {
427 self->base.inertia = self->type->spawn_inertia;
428 }
429 }
430 } else {
431 self->base.tick_minor = 0;
432 self->base.anim_frame = 3;
433 self->base.inertia.x = FIXED_INT(0);
434 }
435 } else if(was_on_ground) {
436 self->base.tick_minor = 0;
437 self->base.anim_frame = 1;
438 } else if(self->base.anim_frame == 1) {
439 enemy_animation_advance(self);
440 }
441
442 ++self->base.tick_minor;
443 if (fixed_point_lt(self->base.inertia.x, FIXED_INT(0))) { self->flags &= ~JUMPNRUN_ENEMY_FACING_RIGHT; }
444 else if(fixed_point_ne(self->base.inertia.x, FIXED_INT(0))) { self->flags |= JUMPNRUN_ENEMY_FACING_RIGHT; }
445 }
446
447 jumpnrun_enemy_type const jumpnrun_enemy_type_data[JUMPNRUN_ENEMY_TYPE_COUNT] = {
448 {
449 .animation_ticks_per_frame = 18,
450 .animation_length = ARRAY_SIZE(anim_cat),
451 .animation_frames = anim_cat,
452 .extent = { FIXED_INT_I(8), FIXED_INT_I(5) },
453 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(2) },
454 { FIXED_INT_I(6), FIXED_INT_I(3) } },
455 .spawn_inertia = { FIXED_POINT_I(0, -200), FIXED_INT_I(0) },
456 .collision_tiles = enemy_collision_tiles_bounce_horiz,
457 .collision_player = enemy_collision_player_jumpable,
458 .collision_shots = enemy_collision_shots_die,
459 .move_tick = enemy_tick_straight_ahead
460 }, {
461 .animation_ticks_per_frame = 12,
462 .animation_length = ARRAY_SIZE(anim_mushroom),
463 .animation_frames = anim_mushroom,
464 .extent = { FIXED_INT_I(7), FIXED_INT_I(7) },
465 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(1) },
466 { FIXED_INT_I(5), FIXED_INT_I(4) } },
467 .spawn_inertia = { FIXED_POINT_I(0, -50), FIXED_INT_I(0) },
468 .collision_tiles = enemy_collision_tiles_bounce_horiz,
469 .collision_player = enemy_collision_player_jumpable,
470 .collision_shots = enemy_collision_shots_die,
471 .move_tick = enemy_tick_straight_ahead
472 }, {
473 .animation_ticks_per_frame = 9,
474 .animation_length = ARRAY_SIZE(anim_bunny),
475 .animation_frames = anim_bunny,
476 .extent = { FIXED_INT_I(7), FIXED_INT_I(5) },
477 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(2) },
478 { FIXED_INT_I(5), FIXED_INT_I(3) } },
479 .spawn_inertia = { FIXED_POINT_I(0, -80), FIXED_POINT_I(0, -800) },
480 .collision_tiles = enemy_collision_tiles_bounce_horiz,
481 .collision_player = enemy_collision_player_jumpable,
482 .collision_shots = enemy_collision_shots_die,
483 .move_tick = enemy_tick_jumper
484 }, {
485 .animation_ticks_per_frame = 6,
486 .animation_length = ARRAY_SIZE(anim_snake),
487 .animation_frames = anim_snake,
488 .extent = { FIXED_INT_I(10), FIXED_INT_I(6) },
489 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(4) },
490 { FIXED_INT_I(8), FIXED_INT_I(2) } },
491 .spawn_inertia = { FIXED_POINT_I(0, -150), FIXED_INT_I(0) },
492 .collision_tiles = enemy_collision_tiles_bounce_horiz,
493 .collision_player = enemy_collision_player_jumpable,
494 .collision_shots = enemy_collision_shots_die,
495 .move_tick = enemy_tick_straight_ahead
496 }, {
497 .animation_ticks_per_frame = 6,
498 .animation_length = ARRAY_SIZE(anim_spiral),
499 .animation_frames = anim_spiral,
500 .extent = { FIXED_INT_I(10), FIXED_INT_I(10) },
501 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(1) },
502 { FIXED_INT_I(8), FIXED_INT_I(8) } },
503 .spawn_inertia = { FIXED_INT_I(0), FIXED_POINT_I(0, -200) },
504 .collision_tiles = enemy_collision_tiles_pass_through,
505 .collision_player = enemy_collision_player_deadly,
506 .collision_shots = enemy_collision_shots_dontcare,
507 .move_tick = enemy_tick_swing_up_and_down
508 }, {
509 .animation_ticks_per_frame = 5,
510 .animation_length = ARRAY_SIZE(anim_rotor),
511 .animation_frames = anim_rotor,
512 .extent = { FIXED_INT_I(9), FIXED_INT_I(9) },
513 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(1) },
514 { FIXED_INT_I(7), FIXED_INT_I(7) } },
515 .spawn_inertia = { FIXED_INT_I(0), FIXED_POINT_I(0, 0) },
516 .collision_tiles = enemy_collision_tiles_pass_through,
517 .collision_player = enemy_collision_player_deadly,
518 .collision_shots = enemy_collision_shots_dontcare,
519 .move_tick = enemy_tick_stationary
520 }, {
521 .animation_ticks_per_frame = 18,
522 .animation_length = ARRAY_SIZE(anim_dog),
523 .animation_frames = anim_dog,
524 .extent = { FIXED_INT_I(8), FIXED_INT_I(5) },
525 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(1) },
526 { FIXED_INT_I(6), FIXED_INT_I(4) } },
527 .spawn_inertia = { FIXED_POINT_I(0, -200), FIXED_POINT_I(0, 0) },
528 .collision_tiles = enemy_collision_tiles_bounce_horiz,
529 .collision_player = enemy_collision_player_jumpable,
530 .collision_shots = enemy_collision_shots_die,
531 .move_tick = enemy_tick_dog
532 }, {
533 .animation_ticks_per_frame = 36,
534 .animation_length = ARRAY_SIZE(anim_giraffe),
535 .animation_frames = anim_giraffe,
536 .extent = { FIXED_INT_I(7), FIXED_INT_I(10) },
537 .hitbox = { { FIXED_INT_I(2), FIXED_INT_I(1) },
538 { FIXED_INT_I(4), FIXED_INT_I(9) } },
539 .spawn_inertia = { FIXED_POINT_I(0, -150), FIXED_POINT_I(-1, -200) },
540 .collision_tiles = enemy_collision_tiles_bounce_horiz,
541 .collision_player = enemy_collision_player_jumpable,
542 .collision_shots = enemy_collision_shots_bounce,
543 .move_tick = enemy_tick_giraffe
544 }, {
545 .animation_ticks_per_frame = 24,
546 .animation_length = ARRAY_SIZE(anim_bird),
547 .animation_frames = anim_bird,
548 .extent = { FIXED_INT_I(9), FIXED_INT_I(7) },
549 .hitbox = { { FIXED_INT_I(1), FIXED_INT_I(3) },
550 { FIXED_INT_I(7), FIXED_INT_I(3) } },
551 .spawn_inertia = { FIXED_POINT_I(0, -400), FIXED_POINT_I(0, -150) },
552 .collision_tiles = enemy_collision_tiles_bounce_horiz,
553 .collision_player = enemy_collision_player_jumpable,
554 .collision_shots = enemy_collision_shots_die,
555 .move_tick = enemy_tick_swing_up_and_down
556 }
557 };
This page took 0.0814780000000001 seconds and 5 git commands to generate.