+ base.x = x;
+ base.y = y;
+ base.width = 0;
+ base.height = 0;
+ base.xm = 0;
+ base.ym = 0;
+
+ stay_on_platform = stay_on_platform_;
+ mode = NORMAL;
+ dying = DYING_NOT;
+ kind = kind_;
+ old_base = base;
+ dir = LEFT;
+ seen = false;
+ frozen_timer.init(true);
+ animation_offset = 0;
+ sprite_left = sprite_right = 0;
+ physic.reset();
+ timer.init(true);
+
+ if(kind == BAD_MRBOMB) {
+ physic.set_velocity(-BADGUY_WALK_SPEED, 0);
+ set_sprite(img_mrbomb_left, img_mrbomb_right);
+ } else if (kind == BAD_MRICEBLOCK) {
+ physic.set_velocity(-BADGUY_WALK_SPEED, 0);
+ set_sprite(img_mriceblock_left, img_mriceblock_right);
+ } else if(kind == BAD_JUMPY) {
+ set_sprite(img_jumpy_left_up, img_jumpy_left_up);
+ } else if(kind == BAD_BOMB) {
+ set_sprite(img_mrbomb_ticking_left, img_mrbomb_ticking_right);
+ // hack so that the bomb doesn't hurt until it expldes...
+ dying = DYING_SQUISHED;
+ } else if(kind == BAD_FLAME) {
+ base.ym = 0; // we misuse base.ym as angle for the flame
+ physic.enable_gravity(false);
+ set_sprite(img_flame, img_flame);
+ } else if(kind == BAD_BOUNCINGSNOWBALL) {
+ physic.set_velocity(-1.3, 0);
+ set_sprite(img_bouncingsnowball_left, img_bouncingsnowball_right);
+ } else if(kind == BAD_STALACTITE) {
+ physic.enable_gravity(false);
+ set_sprite(img_stalactite, img_stalactite);
+ } else if(kind == BAD_FISH) {
+ set_sprite(img_fish, img_fish);
+ physic.enable_gravity(true);
+ } else if(kind == BAD_FLYINGSNOWBALL) {
+ set_sprite(img_flyingsnowball, img_flyingsnowball);
+ physic.enable_gravity(false);
+ } else if(kind == BAD_SPIKY) {
+ physic.set_velocity(-BADGUY_WALK_SPEED, 0);
+ set_sprite(img_spiky_left, img_spiky_right);
+ } else if(kind == BAD_SNOWBALL) {
+ physic.set_velocity(-BADGUY_WALK_SPEED, 0);
+ set_sprite(img_snowball_left, img_snowball_right);
+ }
+
+ // if we're in a solid tile at start correct that now
+ if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base))
+ {
+ std::cout << "Warning: badguy started in wall: kind: " << badguykind_to_string(kind)
+ << " pos: (" << base.x << ", " << base.y << ")" << std::endl;
+ while(collision_object_map(base))
+ --base.y;
+ }