4 // Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 // Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
6 // Copyright (C) 2004 Matthias Braun <matze@braunis.de>
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License
10 // as published by the Free Software Foundation; either version 2
11 // of the License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
33 #include "resources.h"
34 #include "sprite_manager.h"
36 Sprite* img_mriceblock_flat_left;
37 Sprite* img_mriceblock_flat_right;
38 Sprite* img_mriceblock_falling_left;
39 Sprite* img_mriceblock_falling_right;
40 Sprite* img_mriceblock_left;
41 Sprite* img_mriceblock_right;
42 Sprite* img_jumpy_left_up;
43 Sprite* img_jumpy_left_down;
44 Sprite* img_jumpy_left_middle;
45 Sprite* img_mrbomb_left;
46 Sprite* img_mrbomb_right;
47 Sprite* img_mrbomb_ticking_left;
48 Sprite* img_mrbomb_ticking_right;
49 Sprite* img_mrbomb_explosion;
50 Sprite* img_stalactite;
51 Sprite* img_stalactite_broken;
54 Sprite* img_fish_down;
55 Sprite* img_bouncingsnowball_left;
56 Sprite* img_bouncingsnowball_right;
57 Sprite* img_bouncingsnowball_squished;
58 Sprite* img_flyingsnowball;
59 Sprite* img_flyingsnowball_squished;
60 Sprite* img_spiky_left;
61 Sprite* img_spiky_right;
62 Sprite* img_snowball_left;
63 Sprite* img_snowball_right;
64 Sprite* img_snowball_squished_left;
65 Sprite* img_snowball_squished_right;
67 #define BADGUY_WALK_SPEED .8f
69 BadGuyKind badguykind_from_string(const std::string& str)
71 if (str == "money" || str == "jumpy") // was money in old maps
73 else if (str == "laptop" || str == "mriceblock") // was laptop in old maps
74 return BAD_MRICEBLOCK;
75 else if (str == "mrbomb")
77 else if (str == "stalactite")
78 return BAD_STALACTITE;
79 else if (str == "flame")
81 else if (str == "fish")
83 else if (str == "bouncingsnowball")
84 return BAD_BOUNCINGSNOWBALL;
85 else if (str == "flyingsnowball")
86 return BAD_FLYINGSNOWBALL;
87 else if (str == "spiky")
89 else if (str == "snowball" || str == "bsod") // was bsod in old maps
93 printf("Couldn't convert badguy: '%s'\n", str.c_str());
98 std::string badguykind_to_string(BadGuyKind kind)
120 case BAD_BOUNCINGSNOWBALL:
121 return "bouncingsnowball";
123 case BAD_FLYINGSNOWBALL:
124 return "flyingsnowball";
137 BadGuy::BadGuy(float x, float y, BadGuyKind kind_, bool stay_on_platform_)
138 : removable(false), squishcount(0)
147 stay_on_platform = stay_on_platform_;
154 animation_offset = 0;
155 sprite_left = sprite_right = 0;
159 if(kind == BAD_MRBOMB) {
160 physic.set_velocity(-BADGUY_WALK_SPEED, 0);
161 set_sprite(img_mrbomb_left, img_mrbomb_right);
162 } else if (kind == BAD_MRICEBLOCK) {
163 physic.set_velocity(-BADGUY_WALK_SPEED, 0);
164 set_sprite(img_mriceblock_left, img_mriceblock_right);
165 } else if(kind == BAD_JUMPY) {
166 set_sprite(img_jumpy_left_up, img_jumpy_left_up);
167 } else if(kind == BAD_BOMB) {
168 set_sprite(img_mrbomb_ticking_left, img_mrbomb_ticking_right);
169 // hack so that the bomb doesn't hurt until it expldes...
170 dying = DYING_SQUISHED;
171 } else if(kind == BAD_FLAME) {
172 base.ym = 0; // we misuse base.ym as angle for the flame
173 physic.enable_gravity(false);
174 set_sprite(img_flame, img_flame);
175 } else if(kind == BAD_BOUNCINGSNOWBALL) {
176 physic.set_velocity(-1.3, 0);
177 set_sprite(img_bouncingsnowball_left, img_bouncingsnowball_right);
178 } else if(kind == BAD_STALACTITE) {
179 physic.enable_gravity(false);
180 set_sprite(img_stalactite, img_stalactite);
181 } else if(kind == BAD_FISH) {
182 set_sprite(img_fish, img_fish);
183 physic.enable_gravity(true);
184 } else if(kind == BAD_FLYINGSNOWBALL) {
185 set_sprite(img_flyingsnowball, img_flyingsnowball);
186 physic.enable_gravity(false);
187 } else if(kind == BAD_SPIKY) {
188 physic.set_velocity(-BADGUY_WALK_SPEED, 0);
189 set_sprite(img_spiky_left, img_spiky_right);
190 } else if(kind == BAD_SNOWBALL) {
191 physic.set_velocity(-BADGUY_WALK_SPEED, 0);
192 set_sprite(img_snowball_left, img_snowball_right);
195 // if we're in a solid tile at start correct that now
196 if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base)) {
197 printf("Warning: badguy started in wall!.\n");
198 while(collision_object_map(base))
204 BadGuy::action_mriceblock(float frame_ratio)
206 Player& tux = *World::current()->get_tux();
211 /* Move left/right: */
215 physic.apply(frame_ratio, base.x, base.y);
216 if (dying != DYING_FALLING)
217 collision_swept_object_map(&old_base,&base);
219 else if (mode == HELD)
220 { /* FIXME: The pbad object shouldn't know about pplayer objects. */
221 /* If we're holding the iceblock */
225 base.x = tux.base.x + 16;
226 base.y = tux.base.y + tux.base.height/1.5 - base.height;
228 else /* facing left */
230 base.x = tux.base.x - 16;
231 base.y = tux.base.y + tux.base.height/1.5 - base.height;
233 if(collision_object_map(base))
236 base.y = tux.base.y + tux.base.height/1.5 - base.height;
239 if(tux.input.fire != DOWN) /* SHOOT! */
248 tux.kick_timer.start(KICKING_TIME);
249 set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
250 physic.set_velocity_x((dir == LEFT) ? -3.5 : 3.5);
251 play_sound(sounds[SND_KICK],SOUND_CENTER_SPEAKER);
258 check_horizontal_bump();
259 if(mode == KICK && changed != dir)
261 /* handle stereo sound (number 10 should be tweaked...)*/
262 if (base.x < scroll_x + screen->w/2 - 10)
263 play_sound(sounds[SND_RICOCHET], SOUND_LEFT_SPEAKER);
264 else if (base.x > scroll_x + screen->w/2 + 10)
265 play_sound(sounds[SND_RICOCHET], SOUND_RIGHT_SPEAKER);
267 play_sound(sounds[SND_RICOCHET], SOUND_CENTER_SPEAKER);
271 /* Handle mode timer: */
277 set_sprite(img_mriceblock_left, img_mriceblock_right);
278 physic.set_velocity( (dir == LEFT) ? -.8 : .8, 0);
284 BadGuy::check_horizontal_bump(bool checkcliff)
286 float halfheight = base.height / 2;
287 if (dir == LEFT && issolid( base.x, (int) base.y + halfheight))
290 physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
293 if (dir == RIGHT && issolid( base.x + base.width, (int)base.y + halfheight))
296 physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
300 // don't check for cliffs when we're falling
303 if(!issolid(base.x + base.width/2, base.y + base.height))
306 if(dir == LEFT && !issolid(base.x, (int) base.y + base.height + halfheight))
309 physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
312 if(dir == RIGHT && !issolid(base.x + base.width,
313 (int) base.y + base.height + halfheight))
316 physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
324 /* Fall if we get off the ground: */
325 if (dying != DYING_FALLING)
327 if (!issolid(base.x+base.width/2, base.y + base.height))
329 // not solid below us? enable gravity
330 physic.enable_gravity(true);
335 if (physic.get_velocity_y() < 0)
337 base.y = int((base.y + base.height)/32) * 32 - base.height;
338 physic.set_velocity_y(0);
340 // no gravity anymore please
341 physic.enable_gravity(false);
343 if (stay_on_platform && mode == NORMAL)
345 if (!issolid(base.x + ((dir == LEFT) ? 0 : base.width),
346 base.y + base.height))
353 physic.set_velocity_x(fabs(physic.get_velocity_x()) * dir == LEFT ? -1 : 1);
360 physic.enable_gravity(true);
371 BadGuy::action_jumpy(float frame_ratio)
373 if (fabsf(physic.get_velocity_y()) < 2.5f)
374 set_sprite(img_jumpy_left_middle, img_jumpy_left_middle);
375 else if (physic.get_velocity_y() < 0)
376 set_sprite(img_jumpy_left_up, img_jumpy_left_up);
378 set_sprite(img_jumpy_left_down, img_jumpy_left_down);
380 Player& tux = *World::current()->get_tux();
382 static const float JUMPV = 6;
385 // jump when on ground
386 if(dying == DYING_NOT && issolid(base.x, base.y+32))
388 physic.set_velocity_y(JUMPV);
389 physic.enable_gravity(true);
393 else if(mode == JUMPY_JUMP)
398 // set direction based on tux
399 if(tux.base.x > base.x)
405 physic.apply(frame_ratio, base.x, base.y);
406 if(dying == DYING_NOT)
407 collision_swept_object_map(&old_base, &base);
411 BadGuy::action_mrbomb(float frame_ratio)
413 if (dying == DYING_NOT)
414 check_horizontal_bump(true);
418 physic.apply(frame_ratio, base.x, base.y);
419 if (dying != DYING_FALLING)
420 collision_swept_object_map(&old_base,&base);
424 BadGuy::action_bomb(float frame_ratio)
426 static const int TICKINGTIME = 1000;
427 static const int EXPLODETIME = 1000;
433 timer.start(TICKINGTIME);
434 } else if(!timer.check()) {
435 if(mode == BOMB_TICKING) {
437 set_sprite(img_mrbomb_explosion, img_mrbomb_explosion);
438 dying = DYING_NOT; // now the bomb hurts
439 timer.start(EXPLODETIME);
441 /* play explosion sound */ // FIXME: is the stereo all right? maybe we should use player cordinates...
442 if (base.x < scroll_x + screen->w/2 - 10)
443 play_sound(sounds[SND_EXPLODE], SOUND_LEFT_SPEAKER);
444 else if (base.x > scroll_x + screen->w/2 + 10)
445 play_sound(sounds[SND_EXPLODE], SOUND_RIGHT_SPEAKER);
447 play_sound(sounds[SND_EXPLODE], SOUND_CENTER_SPEAKER);
449 } else if(mode == BOMB_EXPLODE) {
456 physic.apply(frame_ratio, base.x, base.y);
457 collision_swept_object_map(&old_base,&base);
461 BadGuy::action_stalactite(float frame_ratio)
463 Player& tux = *World::current()->get_tux();
465 static const int SHAKETIME = 800;
466 static const int RANGE = 40;
469 // start shaking when tux is below the stalactite and at least 40 pixels
471 if(tux.base.x + 32 > base.x - RANGE && tux.base.x < base.x + 32 + RANGE
472 && tux.base.y + tux.base.height > base.y) {
473 timer.start(SHAKETIME);
474 mode = STALACTITE_SHAKING;
476 } if(mode == STALACTITE_SHAKING) {
477 base.x = old_base.x + (rand() % 6) - 3; // TODO this could be done nicer...
479 mode = STALACTITE_FALL;
481 } else if(mode == STALACTITE_FALL) {
483 /* Destroy if we collides with land */
484 if(issolid(base.x+base.width/2, base.y+base.height))
487 dying = DYING_SQUISHED;
489 set_sprite(img_stalactite_broken, img_stalactite_broken);
491 } else if(mode == FLAT) {
496 physic.apply(frame_ratio, base.x, base.y);
498 if(dying == DYING_SQUISHED && !timer.check())
503 BadGuy::action_flame(float frame_ratio)
505 static const float radius = 100;
506 static const float speed = 0.02;
507 base.x = old_base.x + cos(base.ym) * radius;
508 base.y = old_base.y + sin(base.ym) * radius;
510 base.ym = fmodf(base.ym + frame_ratio * speed, 2*M_PI);
514 BadGuy::action_fish(float frame_ratio)
516 static const float JUMPV = 6;
517 static const int WAITTIME = 1000;
519 // go in wait mode when back in water
520 if(dying == DYING_NOT && gettile(base.x, base.y+ base.height)->water
521 && physic.get_velocity_y() <= 0 && mode == NORMAL)
525 physic.set_velocity(0, 0);
526 physic.enable_gravity(false);
527 timer.start(WAITTIME);
529 else if(mode == FISH_WAIT && !timer.check())
532 set_sprite(img_fish, img_fish);
534 physic.set_velocity(0, JUMPV);
535 physic.enable_gravity(true);
538 physic.apply(frame_ratio, base.x, base.y);
539 if(dying == DYING_NOT)
540 collision_swept_object_map(&old_base, &base);
542 if(physic.get_velocity_y() < 0)
543 set_sprite(img_fish_down, img_fish_down);
547 BadGuy::action_bouncingsnowball(float frame_ratio)
549 static const float JUMPV = 4.5;
553 // jump when on ground
554 if(dying == DYING_NOT && issolid(base.x, base.y+32))
556 physic.set_velocity_y(JUMPV);
557 physic.enable_gravity(true);
564 // check for right/left collisions
565 check_horizontal_bump();
567 physic.apply(frame_ratio, base.x, base.y);
568 if(dying == DYING_NOT)
569 collision_swept_object_map(&old_base, &base);
571 // Handle dying timer:
572 if (dying == DYING_SQUISHED && !timer.check())
574 /* Remove it if time's up: */
581 BadGuy::action_flyingsnowball(float frame_ratio)
583 static const float FLYINGSPEED = 1;
584 static const int DIRCHANGETIME = 1000;
586 // go into flyup mode if none specified yet
587 if(dying == DYING_NOT && mode == NORMAL) {
589 physic.set_velocity_y(FLYINGSPEED);
590 timer.start(DIRCHANGETIME/2);
593 if(dying == DYING_NOT && !timer.check()) {
596 physic.set_velocity_y(-FLYINGSPEED);
597 } else if(mode == FLY_DOWN) {
599 physic.set_velocity_y(FLYINGSPEED);
601 timer.start(DIRCHANGETIME);
604 if(dying != DYING_NOT)
605 physic.enable_gravity(true);
607 physic.apply(frame_ratio, base.x, base.y);
608 if(dying == DYING_NOT || dying == DYING_SQUISHED)
609 collision_swept_object_map(&old_base, &base);
611 // Handle dying timer:
612 if (dying == DYING_SQUISHED && !timer.check())
614 /* Remove it if time's up: */
621 BadGuy::action_spiky(float frame_ratio)
623 if (dying == DYING_NOT)
624 check_horizontal_bump();
628 // jump when we're about to fall
629 if (physic.get_velocity_y() == 0 &&
630 !issolid(base.x+base.width/2, base.y + base.height)) {
631 physic.enable_gravity(true);
632 physic.set_velocity_y(2);
636 physic.apply(frame_ratio, base.x, base.y);
637 if (dying != DYING_FALLING)
638 collision_swept_object_map(&old_base,&base);
642 BadGuy::action_snowball(float frame_ratio)
644 if (dying == DYING_NOT)
645 check_horizontal_bump();
649 physic.apply(frame_ratio, base.x, base.y);
650 if (dying != DYING_FALLING)
651 collision_swept_object_map(&old_base,&base);
655 BadGuy::action(float frame_ratio)
657 // Remove if it's far off the screen:
658 if (base.x < scroll_x - OFFSCREEN_DISTANCE)
664 // BadGuy fall below the ground
665 if (base.y > screen->h) {
670 // Once it's on screen, it's activated!
671 if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE)
680 action_mriceblock(frame_ratio);
684 action_jumpy(frame_ratio);
688 action_mrbomb(frame_ratio);
692 action_bomb(frame_ratio);
696 action_stalactite(frame_ratio);
700 action_flame(frame_ratio);
704 action_fish(frame_ratio);
707 case BAD_BOUNCINGSNOWBALL:
708 action_bouncingsnowball(frame_ratio);
711 case BAD_FLYINGSNOWBALL:
712 action_flyingsnowball(frame_ratio);
716 action_spiky(frame_ratio);
720 action_snowball(frame_ratio);
728 // Don't try to draw stuff that is outside of the screen
729 if(base.x <= scroll_x - base.width || base.x >= scroll_x + screen->w)
732 if(sprite_left == 0 || sprite_right == 0)
737 Sprite* sprite = (dir == LEFT) ? sprite_left : sprite_right;
738 sprite->draw(base.x - scroll_x, base.y);
741 fillrect(base.x - scroll_x, base.y, base.width, base.height, 75,0,75, 150);
745 BadGuy::set_sprite(Sprite* left, Sprite* right)
754 // FIXME: Using the image size for the physics and collision is
755 // a bad idea, since images should always overlap there physical
758 if(base.width == 0 && base.height == 0) {
759 base.width = left->get_width();
760 base.height = left->get_height();
761 } else if(base.width != left->get_width() || base.height != left->get_height()) {
762 base.x -= (left->get_width() - base.width) / 2;
763 base.y -= left->get_height() - base.height;
764 base.width = left->get_width();
765 base.height = left->get_height();
769 base.width = base.height = 0;
773 animation_offset = 0;
775 sprite_right = right;
781 // these can't be bumped
782 if(kind == BAD_FLAME || kind == BAD_BOMB || kind == BAD_FISH
783 || kind == BAD_FLYINGSNOWBALL)
790 BadGuy::make_player_jump(Player* player)
792 player->physic.set_velocity_y(2);
793 player->base.y = base.y - player->base.height - 2;
797 BadGuy::squish_me(Player* player)
799 make_player_jump(player);
801 World::current()->add_score(base.x - scroll_x,
802 base.y, 50 * player_status.score_multiplier);
803 play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
804 player_status.score_multiplier++;
806 dying = DYING_SQUISHED;
808 physic.set_velocity(0, 0);
812 BadGuy::squish(Player* player)
814 static const int MAX_ICEBLOCK_SQUICHES = 10;
816 if(kind == BAD_MRBOMB) {
817 // mrbomb transforms into a bomb now
818 World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
820 make_player_jump(player);
821 World::current()->add_score(base.x - scroll_x, base.y, 50 * player_status.score_multiplier);
822 play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
823 player_status.score_multiplier++;
827 } else if (kind == BAD_MRICEBLOCK) {
828 if (mode == NORMAL || mode == KICK)
831 play_sound(sounds[SND_STOMP], SOUND_CENTER_SPEAKER);
833 set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
834 physic.set_velocity_x(0);
837 } else if (mode == FLAT) {
839 play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER);
841 if (player->base.x < base.x + (base.width/2)) {
842 physic.set_velocity_x(5);
845 physic.set_velocity_x(-5);
850 player->kick_timer.start(KICKING_TIME);
851 set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
854 make_player_jump(player);
856 player_status.score_multiplier++;
858 // check for maximum number of squiches
860 if(squishcount >= MAX_ICEBLOCK_SQUICHES) {
866 } else if(kind == BAD_FISH) {
867 // fish can only be killed when falling down
868 if(physic.get_velocity_y() >= 0)
871 make_player_jump(player);
873 World::current()->add_score(base.x - scroll_x, base.y, 25 * player_status.score_multiplier);
874 player_status.score_multiplier++;
876 // simply remove the fish...
879 } else if(kind == BAD_BOUNCINGSNOWBALL) {
881 set_sprite(img_bouncingsnowball_squished,img_bouncingsnowball_squished);
883 } else if(kind == BAD_FLYINGSNOWBALL) {
885 set_sprite(img_flyingsnowball_squished,img_flyingsnowball_squished);
887 } else if(kind == BAD_SNOWBALL) {
889 set_sprite(img_snowball_squished_left, img_snowball_squished_right);
895 BadGuy::kill_me(int score)
897 if(kind == BAD_BOMB || kind == BAD_STALACTITE || kind == BAD_FLAME)
900 dying = DYING_FALLING;
901 if(kind == BAD_MRICEBLOCK) {
902 set_sprite(img_mriceblock_falling_left, img_mriceblock_falling_right);
905 Player& tux = *World::current()->get_tux();
906 tux.holding_something = false;
910 physic.enable_gravity(true);
911 physic.set_velocity_y(0);
913 /* Gain some points: */
914 World::current()->add_score(base.x - scroll_x, base.y,
915 score * player_status.score_multiplier);
917 /* Play death sound: */
918 play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
922 BadGuy::collision(void *p_c_object, int c_object, CollisionType type)
924 BadGuy* pbad_c = NULL;
926 if(type == COLLISION_BUMP) {
931 if(type == COLLISION_SQUISH) {
932 Player* player = static_cast<Player*>(p_c_object);
937 /* COLLISION_NORMAL */
945 pbad_c = (BadGuy*) p_c_object;
947 /* If we're a kicked mriceblock, kill any badguys we hit */
948 if(kind == BAD_MRICEBLOCK && mode == KICK)
953 // a held mriceblock gets kills the enemy too but falls to ground then
954 else if(kind == BAD_MRICEBLOCK && mode == HELD)
960 /* Kill badguys that run into exploding bomb */
961 else if (kind == BAD_BOMB && dying == DYING_NOT)
963 if (pbad_c->kind == BAD_MRBOMB)
965 // mrbomb transforms into a bomb now
966 World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y,
971 else if (pbad_c->kind != BAD_MRBOMB)
977 /* Kill any badguys that get hit by stalactite */
978 else if (kind == BAD_STALACTITE && dying == DYING_NOT)
983 /* When enemies run into eachother, make them change directions */
986 // Jumpy, fish, flame, stalactites are exceptions
987 if (pbad_c->kind == BAD_JUMPY || pbad_c->kind == BAD_FLAME
988 || pbad_c->kind == BAD_STALACTITE || pbad_c->kind == BAD_FISH)
991 // Bounce off of other badguy if we land on top of him
992 if (base.y + base.height < pbad_c->base.y + pbad_c->base.height)
994 if (pbad_c->dir == LEFT)
996 else if (pbad_c->dir == RIGHT)
999 physic.set_velocity(fabs(physic.get_velocity_x()) * dir == LEFT ? -1 : 1, 2);
1003 else if (base.y + base.height > pbad_c->base.y + pbad_c->base.height)
1006 if (pbad_c->kind != BAD_FLAME)
1010 else if (dir == RIGHT)
1013 physic.set_velocity_x(fabs(physic.get_velocity_x()) * dir == LEFT ? -1 : 1);
1020 Player* player = static_cast<Player*>(p_c_object);
1021 /* Get kicked if were flat */
1022 if (mode == FLAT && !dying)
1024 play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER);
1026 // Hit from left side
1027 if (player->base.x < base.x) {
1028 physic.set_velocity_x(5);
1031 // Hit from right side
1033 physic.set_velocity_x(-5);
1038 player->kick_timer.start(KICKING_TIME);
1039 set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
1046 //---------------------------------------------------------------------------
1048 void load_badguy_gfx()
1050 img_mriceblock_flat_left = sprite_manager->load("mriceblock-flat-left");
1051 img_mriceblock_flat_right = sprite_manager->load("mriceblock-flat-right");
1052 img_mriceblock_falling_left = sprite_manager->load("mriceblock-falling-left");
1053 img_mriceblock_falling_right = sprite_manager->load("mriceblock-falling-right");
1054 img_mriceblock_left = sprite_manager->load("mriceblock-left");
1055 img_mriceblock_right = sprite_manager->load("mriceblock-right");
1056 img_jumpy_left_up = sprite_manager->load("jumpy-left-up");
1057 img_jumpy_left_down = sprite_manager->load("jumpy-left-down");
1058 img_jumpy_left_middle = sprite_manager->load("jumpy-left-middle");
1059 img_mrbomb_left = sprite_manager->load("mrbomb-left");
1060 img_mrbomb_right = sprite_manager->load("mrbomb-right");
1061 img_mrbomb_ticking_left = sprite_manager->load("mrbomb-ticking-left");
1062 img_mrbomb_ticking_right = sprite_manager->load("mrbomb-ticking-right");
1063 img_mrbomb_explosion = sprite_manager->load("mrbomb-explosion");
1064 img_stalactite = sprite_manager->load("stalactite");
1065 img_stalactite_broken = sprite_manager->load("stalactite-broken");
1066 img_flame = sprite_manager->load("flame");
1067 img_fish = sprite_manager->load("fish");
1068 img_fish_down = sprite_manager->load("fish-down");
1069 img_bouncingsnowball_left = sprite_manager->load("bouncingsnowball-left");
1070 img_bouncingsnowball_right = sprite_manager->load("bouncingsnowball-right");
1071 img_bouncingsnowball_squished = sprite_manager->load("bouncingsnowball-squished");
1072 img_flyingsnowball = sprite_manager->load("flyingsnowball");
1073 img_flyingsnowball_squished = sprite_manager->load("flyingsnowball-squished");
1074 img_spiky_left = sprite_manager->load("spiky-left");
1075 img_spiky_right = sprite_manager->load("spiky-right");
1076 img_snowball_left = sprite_manager->load("snowball-left");
1077 img_snowball_right = sprite_manager->load("snowball-right");
1078 img_snowball_squished_left = sprite_manager->load("snowball-squished-left");
1079 img_snowball_squished_right = sprite_manager->load("snowball-squished-right");
1082 void free_badguy_gfx()