- if(keystate[SDLK_SPACE] && (state == HIGH_SCORE_DISPLAY || state == TITLE_PAGE)) {
- reset_sprites();
- reset_rocks();
-
- ship.x = XSIZE/2.2; ship.y = YSIZE/2;
- ship.dx = screendx; ship.dy = screendy;
- ship.lives = 4;
- ship.flags = ALL_FLAGS;
- add_sprite(SPRITE(&ship));
-
- score = 0;
-
- state = GAMEPLAY;
- play_tune(TUNE_GAMEPLAY);
+ if(keystate[SDLK_SPACE]
+ && (state == HIGH_SCORE_DISPLAY
+ || state == TITLE_PAGE
+ || state == GAME_OVER)) {
+ if(state == GAME_OVER && new_high_score(score))
+ init_score_entry();
+ else {
+ reset_sprites();
+ reset_rocks();
+ screendx = SCREENDXMIN; screendy = 0;
+
+ ship.x = XSIZE/2.2; ship.y = YSIZE/2;
+ ship.dx = screendx; ship.dy = screendy;
+ ship.lives = 4;
+ ship.flags = MOVE|DRAW|COLLIDE;
+ // SDL_SetAlpha(ship.image, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); // FADE SHIP
+ add_sprite(SPRITE(&ship));
+
+ score = 0;
+
+ state = GAMEPLAY;
+ play_tune(TUNE_GAMEPLAY);
+ }