bkgd_bottom.green = 255;
bkgd_bottom.blue = 255;
endpos = 0;
+ use_endsequence = false;
for(int i = 0; i < 15; ++i)
{
{
LispReader reader(lisp_cdr(root_obj));
reader.read_int("version", &version);
+ reader.read_bool("use-endsequence", &use_endsequence);
reader.read_int("width", &width);
if (!reader.read_int("start_pos_x", &start_pos_x)) start_pos_x = 100;
if (!reader.read_int("start_pos_y", &start_pos_y)) start_pos_y = 170;
// Mark the end position of this level!
// FIXME: -10 is a rather random value, we still need some kind of
// real levelend gola
- endpos = 32*(width-20);
+ if (use_endsequence)
+ endpos = 32*(width-20);
+ else
+ endpos = 32*(width-15);
fclose(fi);
return 0;
int start_pos_x;
int start_pos_y;
int endpos;
+ bool use_endsequence;
float gravity;
std::vector<BadGuyData> badguy_data;
pos_x = screen->w/2;
pos_y = screen->h/2;
has_backitem = false;
- last_id = 0;
arrange_left = 0;
active_item = 0;
effect.init(false);
if(kind_ == MN_BACK)
has_backitem = true;
- if(id == -1 && item.size() == (unsigned)last_id)
- {
- id = last_id;
- last_id++;
- }
-
+ if(id == -1)
+ id = int(item.size());
+
additem(MenuItem::create(kind_, text_.c_str(), toggle_, menu_, id, int_p));
}
int
Menu::check()
{
- return item[hit_item].id;
- /*
- if (item.size() != 0)
- {
- if((item[active_item].kind == MN_ACTION
- || item[active_item].kind == MN_TEXTFIELD
- || item[active_item].kind == MN_NUMFIELD)
- && item[active_item].toggled)
- {
- item[active_item].toggled = false;
- Menu::set_current(0);
- return active_item;
- }
- else if(item[active_item].kind == MN_TOGGLE
- || item[active_item].kind == MN_GOTO)
- {
- return active_item;
- }
- else
- return -1;
- }
+ if (hit_item != -1)
+ return item[hit_item].id;
else
return -1;
- */
}
void
int pos_x;
int pos_y;
bool has_backitem;
- int last_id;
/** input event for the menu (up, down, left, right, etc.) */
MenuAction menuaction;
Sprite* smalltux_gameover;
Sprite* smalltux_skid_left;
Sprite* smalltux_skid_right;
+
+Sprite* smalltux_kick_left;
+Sprite* smalltux_kick_right;
+Sprite* smalltux_grab_left;
+Sprite* smalltux_grab_right;
+
+Sprite* largetux_kick_left;
+Sprite* largetux_kick_right;
+Sprite* largetux_grab_left;
+Sprite* largetux_grab_right;
+
Sprite* largetux_stand_left;
Sprite* largetux_stand_right;
extern Sprite* smalltux_gameover;
extern Sprite* largetux_stand_left;
extern Sprite* largetux_stand_right;
+
+extern Sprite* smalltux_kick_left;
+extern Sprite* smalltux_kick_right;
+extern Sprite* smalltux_grab_left;
+extern Sprite* smalltux_grab_right;
+
+extern Sprite* largetux_kick_left;
+extern Sprite* largetux_kick_right;
+extern Sprite* largetux_grab_left;
+extern Sprite* largetux_grab_right;
+
extern Sprite* bigtux_right;
extern Sprite* bigtux_left;
extern Sprite* bigtux_right_jump;
sprite_manager = new SpriteManager(datadir + "/supertux.strf");
/* Tuxes: */
+ smalltux_kick_left = sprite_manager->load("smalltux-kick-left");
+ smalltux_kick_right = sprite_manager->load("smalltux-kick-right");
+ smalltux_grab_left = sprite_manager->load("smalltux-grab-left");
+ smalltux_grab_right = sprite_manager->load("smalltux-grab-right");
+
+ largetux_kick_left = sprite_manager->load("largetux-kick-left");
+ largetux_kick_right = sprite_manager->load("largetux-kick-right");
+ largetux_grab_left = sprite_manager->load("largetux-grab-left");
+ largetux_grab_right = sprite_manager->load("largetux-grab-right");
+
largetux_stand_left = sprite_manager->load("largetux-stand-left");
largetux_stand_right = sprite_manager->load("largetux-stand-right");