old_base = base;
dir = LEFT;
seen = false;
+ frozen_timer.init(true);
animation_offset = 0;
sprite_left = sprite_right = 0;
physic.reset();
if(!seen)
return;
+ if(frozen_timer.check())
+ return;
+
switch (kind)
{
case BAD_MRICEBLOCK:
}
Sprite* sprite = (dir == LEFT) ? sprite_left : sprite_right;
- sprite->draw(base.x - scroll_x, base.y);
+ sprite->draw(base.x, base.y);
if (debug_mode)
- fillrect(base.x - scroll_x, base.y, base.width, base.height, 75,0,75, 150);
+ fillrect(base.x - scroll_x, base.y - scroll_y, base.width, base.height, 75,0,75, 150);
}
void
{
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x,
+ World::current()->add_score(base.x,
base.y, 50 * player_status.score_multiplier);
play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
player_status.score_multiplier++;
World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x, base.y, 50 * player_status.score_multiplier);
+ World::current()->add_score(base.x, base.y, 50 * player_status.score_multiplier);
play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
player_status.score_multiplier++;
remove_me();
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x, base.y, 25 * player_status.score_multiplier);
+ World::current()->add_score(base.x, base.y, 25 * player_status.score_multiplier);
player_status.score_multiplier++;
// simply remove the fish...
physic.enable_gravity(true);
/* Gain some points: */
- World::current()->add_score(base.x - scroll_x, base.y,
+ World::current()->add_score(base.x, base.y,
score * player_status.score_multiplier);
/* Play death sound: */
play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
}
+void BadGuy::explode(BadGuy *badguy)
+{
+World::current()->add_bad_guy(badguy->base.x, badguy->base.y, BAD_BOMB);
+badguy->remove_me();
+}
+
void
BadGuy::collision(void *p_c_object, int c_object, CollisionType type)
{
BadGuy* pbad_c = NULL;
+ Bullet* pbullet_c = NULL;
if(type == COLLISION_BUMP) {
bump();
switch (c_object)
{
case CO_BULLET:
- kill_me(10);
+ pbullet_c = (Bullet*) p_c_object;
+
+ if(pbullet_c->kind == FIRE_BULLET)
+ kill_me(10);
+ else if(pbullet_c->kind == ICE_BULLET)
+ frozen_timer.start(FROZEN_TIME);
break;
case CO_BADGUY:
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y,
- BAD_BOMB);
- pbad_c->remove_me();
+ explode(pbad_c);
return;
}
else if (pbad_c->kind != BAD_MRBOMB)
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y,
- BAD_BOMB);
- pbad_c->remove_me();
+ explode(pbad_c);
return;
}
else
}
}
+
//---------------------------------------------------------------------------
void load_badguy_gfx()