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" }
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" }
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" }
29 static badge_sprite
const anim_snake
[] = {
30 { 10, 6, (uint8_t const *) "\x10\x86\x83\x30\x04\x83\xa2\x0f" },
31 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x0c\xc1\xa2\x0f" },
32 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x08\x82\xe0\x0f" },
33 { 10, 6, (uint8_t const *) "\x10\x86\x83\x20\x08\x86\xe1\x0f" }
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" }
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" }
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" }
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" }
70 static void enemy_animation_advance(jumpnrun_enemy
*enemy
) {
71 ++enemy
->base
.tick_minor
;
72 if(enemy
->base
.tick_minor
== enemy
->type
->animation_ticks_per_frame
) {
73 enemy
->base
.tick_minor
= 0;
75 ++enemy
->base
.anim_frame
;
76 if(enemy
->base
.anim_frame
>= enemy
->type
->animation_length
) {
77 enemy
->base
.anim_frame
= 0;
82 void jumpnrun_process_enemy(jumpnrun_enemy
*self
,
83 badge_framebuffer
*fb
,
84 struct jumpnrun_game_state
*state
,
85 struct jumpnrun_level
*lv
,
86 struct jumpnrun_tile_range
const *visible_tiles
,
87 vec2d
*player_inertia_mod
) {
88 int const spawn_margin
= 1 + self
->type
->animation_frames
[self
->base
.anim_frame
].width
;
90 if(self
->flags
& JUMPNRUN_ENEMY_SPAWNED
) {
91 if(fixed_point_lt(rectangle_left(enemy_box(self
)), FIXED_POINT(state
->left
- spawn_margin
, 0)) ||
92 fixed_point_gt(rectangle_left(enemy_box(self
)), FIXED_POINT(state
->left
+ BADGE_DISPLAY_WIDTH
+ spawn_margin
, 0)) ||
93 fixed_point_gt(rectangle_top (enemy_box(self
)), FIXED_POINT(BADGE_DISPLAY_HEIGHT
, 0))) {
94 self
->flags
&= ~JUMPNRUN_ENEMY_SPAWNED
;
96 self
->type
->game_tick(self
, state
, lv
, visible_tiles
, player_inertia_mod
);
99 badge_framebuffer_blt(fb
,
100 fixed_point_cast_int(rectangle_left(enemy_box(self
))) - state
->left
,
101 fixed_point_cast_int(rectangle_top (enemy_box(self
))),
103 enemy_render_flags(self
));
106 } else if(self
->flags
& JUMPNRUN_ENEMY_UNAVAILABLE
) {
107 if(state
->left
> fixed_point_cast_int(self
->spawn_pos
.x
) + spawn_margin
||
108 state
->left
+ BADGE_DISPLAY_WIDTH
+ spawn_margin
< fixed_point_cast_int(self
->spawn_pos
.x
)) {
109 self
->flags
&= ~JUMPNRUN_ENEMY_UNAVAILABLE
;
111 } else if((fixed_point_gt(self
->spawn_pos
.x
, FIXED_POINT(state
->left
- spawn_margin
, 0)) &&
112 fixed_point_lt(self
->spawn_pos
.x
, FIXED_POINT(state
->left
- spawn_margin
/ 2, 0))) ||
113 (fixed_point_lt(self
->spawn_pos
.x
, FIXED_POINT(state
->left
+ BADGE_DISPLAY_WIDTH
+ spawn_margin
, 0)) &&
114 fixed_point_gt(self
->spawn_pos
.x
, FIXED_POINT(state
->left
+ BADGE_DISPLAY_WIDTH
, 0)))) {
115 // enemy unspawned, available and in spawn zone.
116 self
->flags
|= JUMPNRUN_ENEMY_SPAWNED
| JUMPNRUN_ENEMY_UNAVAILABLE
;
117 self
->base
.current_box
= rectangle_new(self
->spawn_pos
, self
->type
->extent
);
118 self
->base
.inertia
= self
->type
->spawn_inertia
;
119 self
->base
.anim_frame
= 0;
120 self
->base
.tick_minor
= 0;
121 self
->base
.touching_ground
= false;
122 self
->base
.jumpable_frames
= 0;
126 void enemy_collision_tiles_bounce_horiz(jumpnrun_enemy
*self
,
127 vec2d
*desired_position
,
129 jumpnrun_tile_range
const *visible_tiles
) {
130 vec2d inertia_mod
= self
->base
.inertia
;
132 collisions_tiles_displace(desired_position
,
138 if(fixed_point_ne(inertia_mod
.x
, self
->base
.inertia
.x
)) {
139 self
->base
.inertia
.x
= fixed_point_neg(self
->base
.inertia
.x
);
143 void enemy_collision_player_deadly(struct jumpnrun_enemy
*self
,
144 struct jumpnrun_game_state
*state
,
145 vec2d
*player_inertia_mod
) {
146 (void) player_inertia_mod
;
148 rectangle rect_self
= enemy_hitbox(self
);
150 if(rectangle_intersect(&rect_self
, &state
->player
.current_box
)) {
151 state
->status
= JUMPNRUN_DEAD
;
155 void enemy_collision_player_jumpable(jumpnrun_enemy
*self
,
156 jumpnrun_game_state
*state
,
157 vec2d
*player_inertia_mod
)
159 rectangle rect_self
= enemy_hitbox(self
);
161 if(rectangle_intersect(&rect_self
, &state
->player
.current_box
)) {
162 if(fixed_point_gt(state
->player
.inertia
.y
, FIXED_POINT(0, 0))) {
163 self
->flags
&= ~JUMPNRUN_ENEMY_SPAWNED
;
164 player_inertia_mod
->y
= FIXED_POINT(0, -250);
165 state
->player
.jumpable_frames
= 12;
167 state
->status
= JUMPNRUN_DEAD
;
172 void enemy_collision_tiles_pass_through(struct jumpnrun_enemy
*self
,
173 vec2d
*desired_position
,
174 struct jumpnrun_level
*lv
,
175 struct jumpnrun_tile_range
const *visible_tiles
) {
177 (void) desired_position
;
179 (void) visible_tiles
;
183 void enemy_tick_straight_ahead(jumpnrun_enemy
*self
,
184 jumpnrun_game_state
*state
,
186 jumpnrun_tile_range
const *visible_tiles
,
187 vec2d
*player_inertia_mod
) {
188 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
190 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
191 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
195 jumpnrun_passive_movement(&self
->base
.inertia
);
197 vec2d new_pos
= vec2d_add(enemy_position(self
), self
->base
.inertia
);
198 self
->type
->collision_tiles(self
, &new_pos
, lv
, visible_tiles
);
199 self
->type
->collision_player(self
, state
, player_inertia_mod
);
200 rectangle_move_to(&self
->base
.current_box
, new_pos
);
202 enemy_animation_advance(self
);
205 void enemy_tick_swing_up_and_down(struct jumpnrun_enemy
*self
,
206 struct jumpnrun_game_state
*state
,
207 struct jumpnrun_level
*lv
,
208 struct jumpnrun_tile_range
const *visible_tiles
,
209 vec2d
*player_inertia_mod
) {
210 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
212 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
213 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
217 vec2d new_pos
= vec2d_add(enemy_position(self
), self
->base
.inertia
);
218 self
->type
->collision_tiles(self
, &new_pos
, lv
, visible_tiles
);
219 self
->type
->collision_player(self
, state
, player_inertia_mod
);
220 rectangle_move_to(&self
->base
.current_box
, new_pos
);
222 self
->base
.inertia
.y
=
223 fixed_point_add(fixed_point_add(self
->base
.inertia
.y
,
224 fixed_point_div(self
->type
->spawn_inertia
.y
, FIXED_INT(3))),
225 fixed_point_mul(FIXED_POINT(0, 5),
226 fixed_point_sub(self
->spawn_pos
.y
,
227 enemy_position(self
).y
)));
229 enemy_animation_advance(self
);
232 void enemy_tick_stationary(struct jumpnrun_enemy
*self
,
233 struct jumpnrun_game_state
*state
,
234 struct jumpnrun_level
*lv
,
235 struct jumpnrun_tile_range
const *visible_tiles
,
236 vec2d
*player_inertia_mod
) {
237 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
239 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
240 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
244 self
->type
->collision_tiles(self
, &self
->base
.current_box
.pos
, lv
, visible_tiles
);
245 self
->type
->collision_player(self
, state
, player_inertia_mod
);
247 enemy_animation_advance(self
);
250 void enemy_tick_jumper(jumpnrun_enemy
*self
,
251 jumpnrun_game_state
*state
,
253 jumpnrun_tile_range
const *visible_tiles
,
254 vec2d
*player_inertia_mod
) {
255 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
257 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
258 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
262 jumpnrun_passive_movement(&self
->base
.inertia
);
264 vec2d new_pos
= vec2d_add(enemy_position(self
), self
->base
.inertia
);
265 self
->type
->collision_tiles(self
, &new_pos
, lv
, visible_tiles
);
266 self
->type
->collision_player(self
, state
, player_inertia_mod
);
267 rectangle_move_to(&self
->base
.current_box
, new_pos
);
269 if(self
->base
.touching_ground
) {
270 self
->base
.inertia
.y
= self
->type
->spawn_inertia
.y
;
273 enemy_animation_advance(self
);
276 void enemy_tick_dog(jumpnrun_enemy
*self
,
277 jumpnrun_game_state
*state
,
279 jumpnrun_tile_range
const *visible_tiles
,
280 vec2d
*player_inertia_mod
) {
281 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
283 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
284 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
288 jumpnrun_passive_movement(&self
->base
.inertia
);
290 vec2d new_pos
= vec2d_add(enemy_position(self
), self
->base
.inertia
);
291 self
->type
->collision_tiles(self
, &new_pos
, lv
, visible_tiles
);
292 self
->type
->collision_player(self
, state
, player_inertia_mod
);
293 rectangle_move_to(&self
->base
.current_box
, new_pos
);
295 if(self
->base
.tick_minor
% self
->type
->animation_ticks_per_frame
== 0) {
296 switch(self
->base
.tick_minor
/ self
->type
->animation_ticks_per_frame
) {
298 self
->base
.tick_minor
= 0;
303 self
->base
.anim_frame
= 0;
304 if(self
->flags
& JUMPNRUN_ENEMY_FACING_RIGHT
) {
305 self
->base
.inertia
.x
= fixed_point_neg(self
->type
->spawn_inertia
.x
);
307 self
->base
.inertia
.x
= self
->type
->spawn_inertia
.x
;
316 self
->base
.anim_frame
= 1;
317 if(self
->flags
& JUMPNRUN_ENEMY_FACING_RIGHT
) {
318 self
->base
.inertia
.x
= fixed_point_neg(self
->type
->spawn_inertia
.x
);
320 self
->base
.inertia
.x
= self
->type
->spawn_inertia
.x
;
326 self
->base
.anim_frame
= 2;
327 self
->base
.inertia
.x
= FIXED_INT(0);
332 self
->base
.anim_frame
= 3;
333 self
->base
.inertia
.x
= FIXED_INT(0);
338 ++self
->base
.tick_minor
;
339 if (fixed_point_lt(self
->base
.inertia
.x
, FIXED_INT(0))) { self
->flags
&= ~JUMPNRUN_ENEMY_FACING_RIGHT
; }
340 else if(fixed_point_ne(self
->base
.inertia
.x
, FIXED_INT(0))) { self
->flags
|= JUMPNRUN_ENEMY_FACING_RIGHT
; }
343 void enemy_tick_giraffe(jumpnrun_enemy
*self
,
344 jumpnrun_game_state
*state
,
346 jumpnrun_tile_range
const *visible_tiles
,
347 vec2d
*player_inertia_mod
) {
348 int screenpos
= fixed_point_cast_int(rectangle_left(&self
->base
.current_box
));
350 if(screenpos
+ JUMPNRUN_MAX_SPAWN_MARGIN
< state
->left
||
351 screenpos
>= state
->left
+ BADGE_DISPLAY_WIDTH
+ JUMPNRUN_MAX_SPAWN_MARGIN
) {
355 bool was_on_ground
= self
->base
.touching_ground
;
357 jumpnrun_passive_movement(&self
->base
.inertia
);
359 vec2d new_pos
= vec2d_add(enemy_position(self
), self
->base
.inertia
);
360 self
->type
->collision_tiles(self
, &new_pos
, lv
, visible_tiles
);
361 self
->type
->collision_player(self
, state
, player_inertia_mod
);
362 rectangle_move_to(&self
->base
.current_box
, new_pos
);
364 if(self
->base
.touching_ground
) {
366 enemy_animation_advance(self
);
367 if(self
->base
.anim_frame
== 0) {
368 if(self
->flags
& JUMPNRUN_ENEMY_FACING_RIGHT
) {
369 self
->base
.inertia
.x
= fixed_point_neg(self
->type
->spawn_inertia
.x
);
370 self
->base
.inertia
.y
= self
->type
->spawn_inertia
.y
;
372 self
->base
.inertia
= self
->type
->spawn_inertia
;
376 self
->base
.tick_minor
= 0;
377 self
->base
.anim_frame
= 3;
378 self
->base
.inertia
.x
= FIXED_INT(0);
380 } else if(was_on_ground
) {
381 self
->base
.tick_minor
= 0;
382 self
->base
.anim_frame
= 1;
383 } else if(self
->base
.anim_frame
== 1) {
384 enemy_animation_advance(self
);
387 ++self
->base
.tick_minor
;
388 if (fixed_point_lt(self
->base
.inertia
.x
, FIXED_INT(0))) { self
->flags
&= ~JUMPNRUN_ENEMY_FACING_RIGHT
; }
389 else if(fixed_point_ne(self
->base
.inertia
.x
, FIXED_INT(0))) { self
->flags
|= JUMPNRUN_ENEMY_FACING_RIGHT
; }
392 jumpnrun_enemy_type
const jumpnrun_enemy_type_data
[JUMPNRUN_ENEMY_TYPE_COUNT
] = {
394 .animation_ticks_per_frame
= 16,
395 .animation_length
= ARRAY_SIZE(anim_cat
),
396 .animation_frames
= anim_cat
,
397 .extent
= { FIXED_INT_I(8), FIXED_INT_I(5) },
398 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(2) },
399 { FIXED_INT_I(6), FIXED_INT_I(3) } },
400 .spawn_inertia
= { FIXED_POINT_I(0, -200), FIXED_INT_I(0) },
401 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
402 .collision_player
= enemy_collision_player_jumpable
,
403 .game_tick
= enemy_tick_straight_ahead
405 .animation_ticks_per_frame
= 12,
406 .animation_length
= ARRAY_SIZE(anim_mushroom
),
407 .animation_frames
= anim_mushroom
,
408 .extent
= { FIXED_INT_I(7), FIXED_INT_I(7) },
409 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(1) },
410 { FIXED_INT_I(5), FIXED_INT_I(4) } },
411 .spawn_inertia
= { FIXED_POINT_I(0, -50), FIXED_INT_I(0) },
412 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
413 .collision_player
= enemy_collision_player_jumpable
,
414 .game_tick
= enemy_tick_straight_ahead
416 .animation_ticks_per_frame
= 9,
417 .animation_length
= ARRAY_SIZE(anim_bunny
),
418 .animation_frames
= anim_bunny
,
419 .extent
= { FIXED_INT_I(7), FIXED_INT_I(5) },
420 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(2) },
421 { FIXED_INT_I(5), FIXED_INT_I(3) } },
422 .spawn_inertia
= { FIXED_POINT_I(0, -80), FIXED_POINT_I(0, -800) },
423 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
424 .collision_player
= enemy_collision_player_jumpable
,
425 .game_tick
= enemy_tick_jumper
427 .animation_ticks_per_frame
= 6,
428 .animation_length
= ARRAY_SIZE(anim_snake
),
429 .animation_frames
= anim_snake
,
430 .extent
= { FIXED_INT_I(10), FIXED_INT_I(6) },
431 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(4) },
432 { FIXED_INT_I(8), FIXED_INT_I(2) } },
433 .spawn_inertia
= { FIXED_POINT_I(0, -150), FIXED_INT_I(0) },
434 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
435 .collision_player
= enemy_collision_player_jumpable
,
436 .game_tick
= enemy_tick_straight_ahead
438 .animation_ticks_per_frame
= 6,
439 .animation_length
= ARRAY_SIZE(anim_spiral
),
440 .animation_frames
= anim_spiral
,
441 .extent
= { FIXED_INT_I(10), FIXED_INT_I(10) },
442 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(1) },
443 { FIXED_INT_I(8), FIXED_INT_I(8) } },
444 .spawn_inertia
= { FIXED_INT_I(0), FIXED_POINT_I(0, -200) },
445 .collision_tiles
= enemy_collision_tiles_pass_through
,
446 .collision_player
= enemy_collision_player_deadly
,
447 .game_tick
= enemy_tick_swing_up_and_down
449 .animation_ticks_per_frame
= 5,
450 .animation_length
= ARRAY_SIZE(anim_rotor
),
451 .animation_frames
= anim_rotor
,
452 .extent
= { FIXED_INT_I(9), FIXED_INT_I(9) },
453 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(1) },
454 { FIXED_INT_I(7), FIXED_INT_I(7) } },
455 .spawn_inertia
= { FIXED_INT_I(0), FIXED_POINT_I(0, 0) },
456 .collision_tiles
= enemy_collision_tiles_pass_through
,
457 .collision_player
= enemy_collision_player_deadly
,
458 .game_tick
= enemy_tick_stationary
460 .animation_ticks_per_frame
= 16,
461 .animation_length
= ARRAY_SIZE(anim_dog
),
462 .animation_frames
= anim_dog
,
463 .extent
= { FIXED_INT_I(8), FIXED_INT_I(5) },
464 .hitbox
= { { FIXED_INT_I(1), FIXED_INT_I(1) },
465 { FIXED_INT_I(6), FIXED_INT_I(4) } },
466 .spawn_inertia
= { FIXED_POINT_I(0, -200), FIXED_POINT_I(0, 0) },
467 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
468 .collision_player
= enemy_collision_player_jumpable
,
469 .game_tick
= enemy_tick_dog
471 .animation_ticks_per_frame
= 36,
472 .animation_length
= ARRAY_SIZE(anim_giraffe
),
473 .animation_frames
= anim_giraffe
,
474 .extent
= { FIXED_INT_I(7), FIXED_INT_I(10) },
475 .hitbox
= { { FIXED_INT_I(2), FIXED_INT_I(1) },
476 { FIXED_INT_I(4), FIXED_INT_I(9) } },
477 .spawn_inertia
= { FIXED_POINT_I(0, -150), FIXED_POINT_I(-1, -200) },
478 .collision_tiles
= enemy_collision_tiles_bounce_horiz
,
479 .collision_player
= enemy_collision_player_jumpable
,
480 .game_tick
= enemy_tick_giraffe