// start shaking when tux is below the stalactite and at least 40 pixels
// near
if(tux.base.x + 32 > base.x - RANGE && tux.base.x < base.x + 32 + RANGE
- && tux.base.y + tux.base.height > base.y) {
+ && tux.base.y + tux.base.height > base.y
+ && tux.dying == DYING_NOT) {
timer.start(SHAKETIME);
mode = STALACTITE_SHAKING;
}
// go in wait mode when back in water
if(dying == DYING_NOT
- && gettile(base.x, base.y+ base.height)->attributes & Tile::WATER
+ && gettile(base.x, base.y + base.height)
+ && gettile(base.x, base.y + base.height)->attributes & Tile::WATER
&& physic.get_velocity_y() <= 0 && mode == NORMAL)
{
mode = FISH_WAIT;
fall();
- if (mode == BGM_BIG)
+ if (mode == BGM_BIG && tux.dying == DYING_NOT)
{
if ((tux.base.x + tux.base.width/2 > base.x + base.width/2) && v_dir == LEFT)
{
return;
if(dying == DYING_FALLING && physic.get_velocity_y() < 0)
- sprite->draw(context, Vector(base.x, base.y), LAYER_OBJECTS, VERTICAL_FLIP);
+ sprite->draw(context, Vector(base.x, base.y), LAYER_FOREGROUNDTILES+1, VERTICAL_FLIP);
else
sprite->draw(context, Vector(base.x, base.y), LAYER_OBJECTS);