Commit d8eeb1f 1 parent a5508a7 commit d8eeb1f Copy full SHA for d8eeb1f
File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -706,6 +706,7 @@ gamestate_t GameState::update( uint32_t p_time )
706
706
/* then it's time to move onto the next one! */
707
707
if ( level->get_brick_count () == 0 )
708
708
{
709
+ output.play_effect_level_complete ();
709
710
load_level ( level->get_level () + 1 );
710
711
}
711
712
Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ OutputManager::OutputManager( void )
40
40
}
41
41
42
42
/* Set up the sound channels. */
43
+ blit::channels[CHANNEL_LEVEL].waveforms = blit::Waveform::TRIANGLE | blit::Waveform::SINE | blit::Waveform::SQUARE;
44
+ blit::channels[CHANNEL_LEVEL].frequency = 3500 ;
45
+ blit::channels[CHANNEL_LEVEL].volume = 0xffff ;
46
+ blit::channels[CHANNEL_LEVEL].attack_ms = 32 ;
47
+ blit::channels[CHANNEL_LEVEL].decay_ms = 512 ;
48
+ blit::channels[CHANNEL_LEVEL].sustain = 256 ;
49
+ blit::channels[CHANNEL_LEVEL].release_ms = 128 ;
50
+
43
51
blit::channels[CHANNEL_FALLING].waveforms = blit::Waveform::SINE;
44
52
blit::channels[CHANNEL_FALLING].frequency = 1000 ;
45
53
blit::channels[CHANNEL_FALLING].volume = 0x3fff ;
@@ -239,6 +247,23 @@ void OutputManager::play_effect_falling( uint8_t p_height )
239
247
}
240
248
241
249
250
+ /*
251
+ * play_effect_level_complete - plays a beep when you clear the level.
252
+ */
253
+
254
+ void OutputManager::play_effect_level_complete ( void )
255
+ {
256
+ /* Only do this if sound effects are enabled. */
257
+ if ( flags.sound_enabled )
258
+ {
259
+ blit::channels[CHANNEL_LEVEL].trigger_attack ();
260
+ }
261
+
262
+ /* All done. */
263
+ return ;
264
+ }
265
+
266
+
242
267
/*
243
268
* play_music / stop_music - runs the compiled-in WAV file. These functions
244
269
* are pretty much lifted from the ever-talented DaftFreak.
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ typedef struct
21
21
} output_flags_t ;
22
22
23
23
#define CHANNEL_MUSIC 0
24
+ #define CHANNEL_LEVEL 4
24
25
#define CHANNEL_FALLING 5
25
26
#define CHANNEL_PICKUP 6
26
27
#define CHANNEL_BOUNCE 7
@@ -47,6 +48,7 @@ class OutputManager
47
48
void play_effect_bounce ( uint16_t );
48
49
void play_effect_pickup ( void );
49
50
void play_effect_falling ( uint8_t );
51
+ void play_effect_level_complete ( void );
50
52
};
51
53
52
54
You can’t perform that action at this time.
0 commit comments