GameSession* GameSession::current_ = 0;
GameSession::GameSession(const std::string& subset_, int levelnb_, int mode)
- : world(0), st_gl_mode(mode), levelnb(levelnb_), end_sequenze(false),
+ : world(0), st_gl_mode(mode), levelnb(levelnb_), end_sequence(false),
subset(subset_)
{
current_ = this;
{
game_pause = false;
exit_status = NONE;
- end_sequenze = false;
+ end_sequence = false;
fps_timer.init(true);
frame_timer.init(true);
void
GameSession::process_events()
{
- if (end_sequenze)
+ if (end_sequence)
{
Player& tux = *world->get_tux();
Player* tux = world->get_tux();
/* End of level? */
- if (tux->base.x >= World::current()->get_level()->endpos + 320)
+ if (tux->base.x >= World::current()->get_level()->endpos + 32 * (get_level()->use_endsequence ? 22 : 10))
{
exit_status = LEVEL_FINISHED;
}
- else if (tux->base.x >= World::current()->get_level()->endpos && !end_sequenze)
+ else if (tux->base.x >= World::current()->get_level()->endpos && !end_sequence)
{
- end_sequenze = true;
+ end_sequence = true;
last_x_pos = -1;
music_manager->halt_music();
}
while (frame_ratio > 0)
{
// Update the world
- if (end_sequenze)
+ if (end_sequence)
action(.5f);
else
action(1.0f);
// FIXME: -10 is a rather random value, we still need some kind of
// real levelend gola
if (use_endsequence)
- endpos = 32*(width-20);
+ endpos = 32*(width-30);
else
endpos = 32*(width-15);
void
Bullet::init(float x, float y, float xm, Direction dir)
{
+ life_count = 3;
base.width = 4;
base.height = 4;
base.ym = 9;
else if (base.ym < -9)
base.ym = -9;
+ life_count -= 1;
}
base.ym = base.ym + 0.5 * frame_ratio;
base.y < 0 ||
base.y > screen->h ||
issolid(base.x + 4, base.y + 2) ||
- issolid(base.x, base.y + 2))
+ issolid(base.x, base.y + 2) ||
+ life_count <= 0)
{
remove_me();
}