void activate_particle_systems(void)
{
- printf("PSys: %s\n", current_level.particle_system.c_str());
if(current_level.particle_system == "clouds")
{
particle_systems.push_back(new CloudParticleSystem);
{
while (SDL_PollEvent(&event))
{
+ /* Check for menu-events, if the menu is shown */
+ if(show_menu)
+ menu_event(event);
switch(event.type)
{
case SDL_QUIT: /* Quit event - quit: */
case SDL_KEYDOWN: /* A keypress! */
key = event.key.keysym.sym;
- /* Check for menu-events, if the menu is shown */
- if(show_menu)
- menu_event(&event.key.keysym);
-
if(tux.key_event(key,DOWN))
break;
tux.input.down = UP;
else
tux.input.down = UP;
-
- /* Handle joystick for the menu */
- if(show_menu)
- {
- if(tux.input.down == DOWN)
- menuaction = MENU_ACTION_DOWN;
- else
- menuaction = MENU_ACTION_UP;
- }
- break;
+
+ break;
default:
break;
}
tux.input.up = UP;
else if (event.jbutton.button == JOY_B)
tux.input.fire = UP;
-
- if(show_menu)
- menuaction = MENU_ACTION_HIT;
+
break;
default:
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)
"/images/shared/bag-right-1.png",
USE_ALPHA);
+ /* Mr. Bomb */
+ for(int i=0; i<4; ++i) {
+ char num[4];
+ snprintf(num, 4, "%d", i);
+ texture_load(&img_mrbomb_left[i],
+ datadir + "/images/shared/mrbomb-left-" + num + ".png", USE_ALPHA);
+ texture_load(&img_mrbomb_right[i],
+ datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA);
+ }
+ /* stalactite */
+ texture_load(&img_stalactite,
+ datadir + "/images/shared/stalactite.png", USE_ALPHA);
+ texture_load(&img_stalactite_broken,
+ datadir + "/images/shared/stalactite-broken.png", USE_ALPHA);
/* Upgrades: */
texture_free(&img_money_right[i]);
}
+ for(i = 0; i < 4; i++) {
+ texture_free(&img_mrbomb_left[i]);
+ texture_free(&img_mrbomb_right[i]);
+ }
+
+ texture_free(&img_stalactite);
+ texture_free(&img_stalactite_broken);
+
texture_free(&img_box_full);
texture_free(&img_box_empty);
if (bad_guys[i].base.x >= x - 32 && bad_guys[i].base.x <= x + 32 &&
bad_guys[i].base.y >= y - 16 && bad_guys[i].base.y <= y + 16)
{
- if (bad_guys[i].kind == BAD_BSOD ||
- bad_guys[i].kind == BAD_LAPTOP)
- {
- bad_guys[i].dying = DYING_FALLING;
- bad_guys[i].base.ym = -8;
- play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
- }
+ bad_guys[i].collision(&tux, CO_PLAYER, COLLISION_BUMP);
}
}