+ play_sound(SOUND_BANG);
+ new_bang_dots(SPRITE(ship));
+ if(--ship->lives) {
+ state = DEAD_PAUSE;
+ state_timeout = DEAD_PAUSE_LENGTH;
+ // want ship to be invisible, but keep drifting at sqrt(speed)
+ // to leave it in the middle of the space from the explosion.
+ ship->flags = MOVE;
+ ship->dx = (ship->dx < 0) ? -sqrt(-ship->dx) : sqrt(ship->dx);
+ ship->dy = (ship->dy < 0) ? -sqrt(-ship->dy) : sqrt(ship->dy);
+ if(ship->dx < SCREENDXMIN) ship->dx = SCREENDXMIN;
+ } else {
+ state = GAME_OVER;
+ state_timeout = 200.0;
+ fadetimer = 0.0;
+ ship->flags = 0;
+ // scrolling is based on the ship speed, so we need to reset it.
+ ship->dx = SCREENDXMIN; ship->dy = 0;
+ }