namespace {
const float KICKSPEED = 500;
const int MAXSQUISHES = 10;
+ const float NOKICK_TIME = 0.1f;
}
MrIceBlock::MrIceBlock(const lisp::Lisp& reader)
if(hit.right && dir == RIGHT) {
dir = LEFT;
sound_manager->play("sounds/iceblock_bump.wav", get_pos());
+ if(++squishcount >= MAXSQUISHES) { kill_fall(); break; }
physic.set_velocity_x(-KICKSPEED);
} else if(hit.left && dir == LEFT) {
dir = RIGHT;
sound_manager->play("sounds/iceblock_bump.wav", get_pos());
+ if(++squishcount >= MAXSQUISHES) { kill_fall(); break; }
physic.set_velocity_x(KICKSPEED);
}
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
}
set_state(ICESTATE_FLAT);
+ nokick_timer.start(NOKICK_TIME);
break;
case ICESTATE_FLAT:
{
dir = LEFT;
}
}
- set_state(ICESTATE_KICKED);
+ if (nokick_timer.check()) set_state(ICESTATE_KICKED);
break;
case ICESTATE_GRABBED:
assert(false);