+}
+
+void
+draw_game_over(void)
+{
+ int x;
+ char *text0, *text1;
+ SDL_Rect dest;
+ float a_game = 0, a_over = 0;
+
+ // fade in "GAME", then "OVER".
+ a_game = min(1.0, faderate*fadetimer/3.0);
+ if(a_game == 1.0) a_over = min(1.0, faderate*fadetimer/3.0 - 1);
+
+ fadetimer += t_frame;
+
+ dest.x = (XSIZE-surf_b_game->w)/2;
+ dest.y = (YSIZE-surf_b_game->h)/2-40;
+ SDL_SetAlpha(surf_b_game, SDL_SRCALPHA, (int)(a_game*(200 + 55*cos(fadetimer))));
+ SDL_BlitSurface(surf_b_game,NULL,surf_screen,&dest);
+
+ dest.x = (XSIZE-surf_b_over->w)/2;
+ dest.y = (YSIZE-surf_b_over->h)/2 + 40;
+ SDL_SetAlpha(surf_b_over, SDL_SRCALPHA, (int)(a_over*(200 + 55*sin(fadetimer))));
+ SDL_BlitSurface(surf_b_over,NULL,surf_screen,&dest);
+
+ if(new_high_score(score)) {
+ text0 = "New High Score!";
+ text1 = "Press SPACE to continue";
+ } else {
+ text0 = msgs[g_easy][0];
+ text1 = msgs[g_easy][1];
+ }
+
+ x = (XSIZE-SFont_TextWidth(g_font,text0))/2 + cos(fadetimer/9)*10;
+ SFont_Write(surf_screen,g_font,x,YSIZE-100 + cos(fadetimer/6)*5,text0);
+
+ x = (XSIZE-SFont_TextWidth(g_font,text1))/2 + sin(fadetimer/9)*10;
+ SFont_Write(surf_screen,g_font,x,YSIZE-50 + sin(fadetimer/4)*5,text1);
+}
+
+void
+draw_title_page(void)
+{
+ int x;
+ char *text;
+ SDL_Rect dest;
+
+ fadetimer += t_frame/2.0;
+
+ dest.x = (XSIZE-surf_b_variations->w)/2 + cos(fadetimer/6.5)*10;
+ dest.y = (YSIZE/2-surf_b_variations->h)/2 + sin(fadetimer/5.0)*10;
+ SDL_SetAlpha(surf_b_variations, SDL_SRCALPHA, (int)(200 + 55*sin(fadetimer)));
+ SDL_BlitSurface(surf_b_variations,NULL,surf_screen,&dest);
+
+ dest.x = (XSIZE-surf_b_on->w)/2 + cos((fadetimer + 1.0)/6.5)*10;
+ dest.y = (YSIZE/2-surf_b_on->h)/2 + surf_b_variations->h + 20 + sin((fadetimer + 1.0)/5.0)*10;
+ SDL_SetAlpha(surf_b_on, SDL_SRCALPHA, (int)(200 + 55*sin(fadetimer-1.0)));
+ SDL_BlitSurface(surf_b_on,NULL,surf_screen,&dest);
+
+ dest.x = (XSIZE-surf_b_rockdodger->w)/2 + cos((fadetimer + 2.0)/6.5)*10;
+ dest.y = (YSIZE/2-surf_b_rockdodger->h)/2 + surf_b_variations->h + surf_b_on->h + 40 + sin((fadetimer + 2.0)/5)*10;
+ SDL_SetAlpha(surf_b_rockdodger, SDL_SRCALPHA, (int)(200 + 55*sin(fadetimer-2.0)));
+ SDL_BlitSurface(surf_b_rockdodger,NULL,surf_screen,&dest);