world->load(filename);
}
-GameSession::GameSession(const std::string& subset_, int levelnb, int mode)
- : subset(subset_)
+GameSession::GameSession(const std::string& subset_, int levelnb_, int mode)
+ : subset(subset_),
+ levelnb(levelnb_)
{
init();
timer_init(&frame_timer, true);
st_gl_mode = mode;
- level = levelnb;
-
+
/* Init the game: */
world->arrays_free();
world->set_defaults();
}
else
{
- if(world->load(subset, level) != 0)
+ if(world->load(subset, levelnb) != 0)
exit(1);
}
/* Level Intro: */
clearscreen(0, 0, 0);
- sprintf(str, "LEVEL %d", level);
+ sprintf(str, "LEVEL %d", levelnb);
text_drawf(&blue_text, str, 0, 200, A_HMIDDLE, A_TOP, 1);
sprintf(str, "%s", world->get_level()->name.c_str());
if (next_level)
{
/* End of a level! */
- level++;
+ levelnb++;
next_level = 0;
if(st_gl_mode != ST_GL_TEST)
{
}
else
{
- if(world->get_level()->load(subset, level) != 0)
+ if(world->get_level()->load(subset, levelnb) != 0)
return 0;
}
// FIXME: Hack for restarting the level
std::string subset;
+ int levelnb;
public:
GameSession();
texture_type img_flag[2];
texture_type img_cloud[2][4];
+texture_type img_box_full;
+texture_type img_box_empty;
+texture_type img_mints;
+texture_type img_coffee;
+texture_type img_super_bkgd;
+texture_type img_red_glow;
+
/* Load graphics/sounds shared between all levels: */
void loadshared()
{
extern texture_type img_flag[2];
extern texture_type img_cloud[2][4];
+extern texture_type img_box_full;
+extern texture_type img_box_empty;
+extern texture_type img_mints;
+extern texture_type img_coffee;
+extern texture_type img_super_bkgd;
+extern texture_type img_red_glow;
+
void loadshared();
void unloadshared();
int score;
int distros;
-int level;
int next_level;
int score_multiplier;
-bool counting_distros;
-int distro_counter;
timer_type super_bkgd_timer;
// FIXME: Move this into a view class
unsigned int global_frame_counter;
-texture_type img_box_full;
-texture_type img_box_empty;
-texture_type img_mints;
-texture_type img_coffee;
-texture_type img_super_bkgd;
-texture_type img_red_glow;
timer_type time_left;
double frame_ratio;
#define FRAME_RATE 10 // 100 Frames per second (10ms)
+// Player stats
extern int score;
extern int distros;
-extern int level;
extern int next_level;
extern int score_multiplier;
-extern bool counting_distros;
-extern int distro_counter;
extern timer_type super_bkgd_timer;
extern float scroll_x;
extern unsigned int global_frame_counter;
-extern texture_type img_box_full, img_box_empty, img_mints, img_coffee, img_super_bkgd, img_red_glow;
extern timer_type time_left;
extern double frame_ratio;
#include "scene.h"
#include "globals.h"
#include "player.h"
+#include "resources.h"
texture_type img_bullet;
texture_type img_golden_herring;
#include "world.h"
#include "level.h"
#include "tile.h"
+#include "resources.h"
texture_type img_distro[4];
std::vector<Bullet> bullets;
std::vector<ParticleSystem*> particle_systems;
- static World* current_;
+ int distro_counter;
+ bool counting_distros;
+ static World* current_;
public:
static World* current() { return current_; }
static void set_current(World* w) { current_ = w; }
#endif /*SUPERTUX_WORLD_H*/
+/* Local Variables: */
+/* mode:c++ */
+/* End */
+