diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-06-03 10:52:37 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-06-03 10:52:37 +0000 |
commit | 6f5a1164f31d4e5594f5a6ce8de328f3b0608fd8 (patch) | |
tree | f00fccd0320a7adff758ff90c759ea5971e1331e /sound.bmx | |
parent | 1c900457e45e70e12a04b2c5b909e0bd9a9d8a3e (diff) |
Initial completed version
Diffstat (limited to 'sound.bmx')
-rw-r--r-- | sound.bmx | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/sound.bmx b/sound.bmx new file mode 100644 index 0000000..2dce3a0 --- /dev/null +++ b/sound.bmx @@ -0,0 +1,75 @@ +' Missile Lock +' +' Copyright (C) 2006 Ian Cowburn (ianc@noddybox.co.uk) +' +' This program is free software; you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation; either version 2 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program; if not, write to the Free Software +' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +' +' ------------------------------------------------------------------------- +' +' $Id$ +' +Strict +Import brl.audio +Import brl.oggloader +Import brl.freeaudioaudio + +Incbin "SFX/alert.ogg" +Incbin "SFX/missile_explode.ogg" +Incbin "SFX/missile_launch.ogg" +Incbin "SFX/ship_explode.ogg" +Incbin "SFX/ship_hit.ogg" + +Type SFX + Global sfx_alert:TSound + Global sfx_missile_explode:TSound + Global sfx_missile_launch:TSound + Global sfx_ship_explode:TSound + Global sfx_ship_hit:TSound + + Function SafeLoadSound:TSound(p:String, loop:Int=False) + Local i:TSound=LoadSound(p,loop) + Assert i,"Failed to load " + p + Return i + End Function + + Function Init() + sfx_alert=SafeLoadSound("incbin::SFX/alert.ogg") + sfx_missile_explode=SafeLoadSound("incbin::SFX/missile_explode.ogg") + sfx_missile_launch=SafeLoadSound("incbin::SFX/missile_launch.ogg") + sfx_ship_explode=SafeLoadSound("incbin::SFX/ship_explode.ogg") + sfx_ship_hit=SafeLoadSound("incbin::SFX/ship_hit.ogg") + End Function + + Function Alert() + PlaySound(sfx_alert) + End Function + + Function MissileExplode() + PlaySound(sfx_missile_explode) + End Function + + Function MissileLaunch() + PlaySound(sfx_missile_launch) + End Function + + Function ShipHit() + PlaySound(sfx_ship_hit) + End Function + + Function ShipExplode() + PlaySound(sfx_ship_explode) + End Function +End Type + |