world->get_level()->load_gfx();
loadshared();
- activate_bad_guys(world->get_level());
+
+ world->activate_bad_guys();
world->activate_particle_systems();
world->get_level()->load_song();
update_time = st_get_ticks();
}
-void activate_bad_guys(Level* plevel)
-{
- for (std::vector<BadGuyData>::iterator i = plevel->badguy_data.begin();
- i != plevel->badguy_data.end();
- ++i)
- {
- world.add_bad_guy(i->x, i->y, i->kind);
- }
-}
-
void
GameSession::process_events()
{
world->get_level()->free_gfx();
world->get_level()->cleanup();
world->get_level()->free_song();
- unloadshared();
world->arrays_free();
+
+ unloadshared();
return(0);
}
tux.level_begin();
if (score > hs_score)
save_hs(score);
}
+
world->get_level()->free_gfx();
world->get_level()->cleanup();
world->get_level()->free_song();
- unloadshared();
world->arrays_free();
+
+ unloadshared();
return(0);
} /* if (lives < 0) */
}
/* Either way, (re-)load the (next) level... */
-
tux.level_begin();
set_defaults();
+
world->get_level()->cleanup();
if (st_gl_mode == ST_GL_LOAD_LEVEL_FILE)
}
world->arrays_free();
- activate_bad_guys(world->get_level());
+ world->activate_bad_guys();
world->activate_particle_systems();
world->get_level()->free_gfx();
set_defaults();
world->get_level()->cleanup();
+ world->arrays_free();
+
if(world->get_level()->load(level_subset,level) != 0)
exit(1);
- world->arrays_free();
- activate_bad_guys(world->get_level());
+ world->activate_bad_guys();
world->activate_particle_systems();
world->get_level()->free_gfx();
}
le_set_defaults();
le_current_level->load_gfx();
- activate_bad_guys(le_current_level);
+ world.activate_bad_guys();
show_menu = true;
}
break;
}
le_set_defaults();
le_current_level->load_gfx();
- activate_bad_guys(le_current_level);
+ world.activate_bad_guys();
menu_item_change_input(&subset_new_menu->item[2],"");
show_menu = true;
break;
le_current_level->free_gfx();
le_current_level->load_gfx();
- activate_bad_guys(le_current_level);
+ world.activate_bad_guys();
}
void le_quit(void)
{
le_current_level->free_gfx();
le_current_level->cleanup();
- unloadshared();
world.arrays_free();
+ unloadshared();
}
}
world.arrays_free();
le_current_level->load_gfx();
loadshared();
- activate_bad_guys(le_current_level);
+ world.activate_bad_guys();
}
void le_showhelp()
particle_systems.clear();
}
+void
+World::activate_bad_guys()
+{
+ for (std::vector<BadGuyData>::iterator i = level->badguy_data.begin();
+ i != level->badguy_data.end();
+ ++i)
+ {
+ add_bad_guy(i->x, i->y, i->kind);
+ }
+}
void
World::activate_particle_systems()
int load(const std::string& filename);
void activate_particle_systems();
+ void activate_bad_guys();
void add_score(float x, float y, int s);
void add_bouncy_distro(float x, float y);