case CO_BADGUY:
pbad_c = (bad_guy_type*) p_c_object;
if (pbad->mode == NORMAL)
- pbad->dir = !pbad->dir;
+ {
+ /* do nothing */
+ }
else
{
/* We're in kick mode, kill the other guy: */
timer_start(&pbad->timer,4000);
physic_set_state(&pplayer_c->vphysic,PH_VT);
physic_set_start_vy(&pplayer_c->vphysic,2.);
+ pplayer_c->base.y = pbad->base.y - pplayer_c->base.height;
add_score(pbad->base.x - scroll_x, pbad->base.y,
50 * score_multiplier);
physic_set_state(&pplayer_c->vphysic,PH_VT);
physic_set_start_vy(&pplayer_c->vphysic,2.);
+ pplayer_c->base.y = pbad->base.y - pplayer_c->base.height;
}
else if (pbad->mode == FLAT)
{
physic_set_state(&pplayer_c->vphysic,PH_VT);
physic_set_start_vy(&pplayer_c->vphysic,2.);
-
+ pplayer_c->base.y = pbad->base.y - pplayer_c->base.height;
+
add_score(pbad->base.x - scroll_x,
pbad->base.y,
25 * score_multiplier);
}
}
+
+
/* CO_BADGUY & CO_PLAYER check */
for(i = 0; i < num_bad_guys; ++i)
{
if(bad_guys[i].dying == NO && rectcollision_offset(&bad_guys[i].base,&tux.base,0,0) == YES )
{
/* We have detected a collision and now call the collision functions of the collided objects. */
- if (tux.base.y + tux.base.height < bad_guys[i].base.y + 8 > 0 && bad_guys[i].kind != BAD_MONEY && bad_guys[i].mode != HELD)
+ if (tux.previous_base.y < tux.base.y &&
+ tux.previous_base.y + tux.previous_base.height < bad_guys[i].base.y + bad_guys[i].base.height/2 &&
+ bad_guys[i].kind != BAD_MONEY && bad_guys[i].mode != HELD)
{
badguy_collision(&bad_guys[i], &tux, CO_PLAYER);
}