From 6f5a1164f31d4e5594f5a6ce8de328f3b0608fd8 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 3 Jun 2006 10:52:37 +0000 Subject: Initial completed version --- sound.bmx | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sound.bmx (limited to 'sound.bmx') 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 + -- cgit v1.2.3