- Tile* tile = gettile(x,y);
- if (!tile->fullbox)
- return;
-
- // according to the collision side, set the upgrade direction
- if(col_side == LEFT)
- col_side = RIGHT;
- else
- col_side = LEFT;
-
- switch(tile->data)
- {
- case 1: // Box with a distro!
- add_bouncy_distro(((int)(x + 1) / 32) * 32, (int)(y / 32) * 32 - 32);
- play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER);
- player_status.score = player_status.score + SCORE_DISTRO;
- player_status.distros++;
- break;
-
- case 2: // Add an upgrade!
- if (tux.size == SMALL) /* Tux is small, add mints! */
- add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_MINTS);
- else /* Tux is big, add coffee: */
- add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_COFFEE);
- play_sound(sounds[SND_UPGRADE], SOUND_CENTER_SPEAKER);
- break;
-
- case 3: // Add a golden herring
- add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_HERRING);
- break;
- default:
- break;
- }
-
- /* Empty the box: */
- level->change(x, y, TM_IA, tile->next_tile);