void game_draw(void)
{
-int y,x;
+ int y,x;
/* Draw screen: */
if (tux.dying && (global_frame_counter % 4) == 0)
}
/* Draw interactive tiles: */
-
for (y = 0; y < 15; ++y)
{
for (x = 0; x < 21; ++x)
}
/* (Bouncy bricks): */
-
for (unsigned int i = 0; i < bouncy_bricks.size(); ++i)
bouncy_brick_draw(&bouncy_bricks[i]);
upgrade_draw(&upgrades[i]);
for (unsigned int i = 0; i < bouncy_distros.size(); ++i)
- bouncy_distro_draw(&bouncy_distros[i]);
+ bouncy_distro_draw(&bouncy_distros[i]);
for (unsigned int i = 0; i < broken_bricks.size(); ++i)
broken_brick_draw(&broken_bricks[i]);
/* Draw foreground: */
-
for (y = 0; y < 15; ++y)
{
for (x = 0; x < 21; ++x)
for(y = 0; y < plevel->width; ++y)
plevel->fg_tiles[i][y] = (unsigned int) '.';
plevel->fg_tiles[i][plevel->width] = (unsigned int) '\0';
-
- plevel->dn_tiles[i] = (unsigned int*) malloc((plevel->width+1)*sizeof(unsigned int));
- plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0';
- for(y = 0; y < plevel->width; ++y)
- plevel->dn_tiles[i][y] = (unsigned int) '.';
- plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0';
}
}
for(int i = 0; i < 15; ++i)
{
- plevel->dn_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) );
plevel->ia_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) );
plevel->bg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) );
plevel->fg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) );
}
fprintf( fi,")\n");
- fprintf(fi," (dynamic-tm ");
-
- for(y = 0; y < 15; ++y)
- {
- for(i = 0; i < plevel->width; ++i)
- fprintf(fi," %d ", plevel->dn_tiles[y][i]);
- }
-
- fprintf( fi,")\n");
fprintf(fi," (foreground-tm ");
for(y = 0; y < 15; ++y)
for(i=0; i < 15; ++i)
free(plevel->ia_tiles[i]);
for(i=0; i < 15; ++i)
- free(plevel->dn_tiles[i]);
- for(i=0; i < 15; ++i)
free(plevel->fg_tiles[i]);
plevel->name.clear();
if(new_width < 21)
new_width = 21;
tilemap_change_size((unsigned int***)&plevel->ia_tiles,new_width,plevel->width);
- tilemap_change_size((unsigned int***)&plevel->dn_tiles,new_width,plevel->width);
tilemap_change_size((unsigned int***)&plevel->bg_tiles,new_width,plevel->width);
tilemap_change_size((unsigned int***)&plevel->fg_tiles,new_width,plevel->width);
plevel->width = new_width;
{
switch(tm)
{
- case 0:
+ case TM_BG:
plevel->bg_tiles[yy][xx] = c;
- case 1:
+ break;
+ case TM_IA:
plevel->ia_tiles[yy][xx] = c;
- case 2:
- plevel->dn_tiles[yy][xx] = c;
- case 4:
+ break;
+ case TM_FG:
plevel->fg_tiles[yy][xx] = c;
+ break;
}
}
}
#define LEVEL_NAME_MAX 20
-enum {
+enum TileMapType {
TM_BG,
TM_IA,
- TM_DN,
TM_FG
};
std::string particle_system;
unsigned int* bg_tiles[15]; /* Tiles in the background */
unsigned int* ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/
- unsigned int* dn_tiles[15]; /* Dynamic tiles (bad guys and moving platforms for example)*/
unsigned int* fg_tiles[15]; /* Tiles in the foreground */
int time_left;
int bkgd_red;
static int le_selection_mode;
static SDL_Event event;
-void le_activate_bad_guys(void)
-{
- int x,y;
-
- /* Activate bad guys: */
-
- /* as oposed to the gameloop.c func, this one doesn't remove
- the badguys from tiles */
-
- for (y = 0; y < 15; ++y)
- for (x = 0; x < le_current_level->width; ++x)
- if (le_current_level->dn_tiles[y][x] >= '0' && le_current_level->dn_tiles[y][x] <= '9')
- add_bad_guy(x * 32, y * 32, static_cast<BadGuyKind>(le_current_level->dn_tiles[y][x] - '0'));
-
-
-
-}
-
void le_set_defaults()
{
if(le_current_level != NULL)
le_update_buttons(le_current_level->theme.c_str());
le_set_defaults();
level_load_gfx(le_current_level);
- le_activate_bad_guys();
show_menu = true;
}
break;
le_update_buttons(le_current_level->theme.c_str());
le_set_defaults();
level_load_gfx(le_current_level);
- le_activate_bad_guys();
menu_item_change_input(&subset_new_menu->item[2],"");
show_menu = true;
break;
level_free_gfx();
level_load_gfx(le_current_level);
-
- le_activate_bad_guys();
}
void le_quit(void)
arrays_init();
level_load_gfx(le_current_level);
loadshared();
- le_activate_bad_guys();
}
void le_showhelp()