| changeset 0 | b2e3aa63e96c |
| -1:000000000000 | 0:b2e3aa63e96c |
|---|---|
1 #include "firealrm.h" |
|
2 |
|
3 int counter = 0; |
|
4 |
|
5 Uint32 ALRM_soundFireAlarm(Uint32 interval) |
|
6 { |
|
7 if(!fireAlarmSystemActivated) |
|
8 { |
|
9 Mix_PlayChannel(-1, alarmSound, 0); |
|
10 fireAlarmSystemActivated = 1; |
|
11 counter += 1; |
|
12 return 100; |
|
13 } |
|
14 |
|
15 else |
|
16 { |
|
17 fireAlarmSystemActivated = 0; |
|
18 if(counter > 2) |
|
19 { |
|
20 counter = 0; |
|
21 return 1800; |
|
22 } |
|
23 return 1000; |
|
24 } |
|
25 } |