2 * Copyright (C) 2003 Robert Kooima
4 * NEVERBALL is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
25 /*---------------------------------------------------------------------------*/
27 static int over_enter(void)
31 if ((id = gui_label(0, _("GAME OVER"), GUI_LRG, GUI_ALL, gui_gry, gui_red)))
37 audio_music_fade_out(2.0f);
38 audio_play(AUD_OVER, 1.f);
45 static void over_leave(int id)
50 static void over_paint(int id, float st)
56 static void over_timer(int id, float dt)
58 if (dt > 0.f && time_state() > 3.f)
59 goto_state(&st_start);
65 static int over_keybd(int c, int d)
67 return (d && c == SDLK_ESCAPE) ? goto_state(&st_start) : 1;
70 static int over_click(int b, int d)
72 return (b < 0 && d == 1) ? goto_state(&st_start) : 1;
75 static int over_buttn(int b, int d)
79 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b) ||
80 config_tst_d(CONFIG_JOYSTICK_BUTTON_B, b) ||
81 config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
82 return goto_state(&st_start);
87 /*---------------------------------------------------------------------------*/
89 struct state st_over = {