3 * Daniel Nelson - 10/27/0
5 * Copyright (C) 2000 Daniel Nelson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
25 * Very simple, but I need somewhere to put this code.
28 #include "CountDownManager.h"
31 #include "MessageManager.h"
32 #include "Displayer.h"
39 int CountDownManager::state
;
40 int CountDownManager::start_pause_alarm
;
41 int CountDownManager::message_switch_alarm
;
43 void CountDownManager::gameStart ( )
45 start_pause_alarm
= GC_START_PAUSE_DELAY
;
46 message_switch_alarm
= GC_START_PAUSE_DELAY
/ 3;
49 MessageManager::readyMessage(state
);
51 Music::fadeout( 3000 );
55 void CountDownManager::cleanUp ( )
57 if (state
!= -1) MessageManager::freeMessage();
60 void CountDownManager::timeStep_inline_split_ ( )
62 if (start_pause_alarm
)
65 if (message_switch_alarm
== 30) {
67 Sound::play( GC_SOUND_COUNTDOWN
, 1 + state
* 3 );
70 if (--message_switch_alarm
== 0) {
72 MessageManager::freeMessage();
73 message_switch_alarm
= 0;
75 } else if (state
== MS_COUNT_DOWN_GO
) {
76 MessageManager::freeMessage();
77 MessageManager::readyMessage(MS_COUNT_DOWN_GO
);
82 message_switch_alarm
= GC_START_PAUSE_DELAY
/ 3;
85 MessageManager::nextMessage(state
);
86 message_switch_alarm
= GC_START_PAUSE_DELAY
/ 3;