summaryrefslogtreecommitdiff
path: root/sounds.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'sounds.bmx')
-rw-r--r--sounds.bmx118
1 files changed, 118 insertions, 0 deletions
diff --git a/sounds.bmx b/sounds.bmx
new file mode 100644
index 0000000..c0bdf5d
--- /dev/null
+++ b/sounds.bmx
@@ -0,0 +1,118 @@
+' Vectoroids
+'
+' Copyright 2005 Ian Cowburn
+'
+' $Id$
+'
+Strict
+
+Incbin "SFX/explode1.wav"
+Incbin "SFX/explode2.wav"
+Incbin "SFX/explode3.wav"
+Incbin "SFX/fire.wav"
+Incbin "SFX/life.wav"
+Incbin "SFX/lsaucer.wav"
+Incbin "SFX/sfire.wav"
+Incbin "SFX/ssaucer.wav"
+Incbin "SFX/thrust.wav"
+Incbin "SFX/thumphi.wav"
+Incbin "SFX/thumplo.wav"
+
+
+Type Sounds
+ Global explode:TSound[]
+ Global fire:TSound
+ Global life:TSound
+ Global lsaucer:TSound
+ Global sfire:TSound
+ Global ssaucer:TSound
+ Global thrust:TSound
+ Global thumphi:TSound
+ Global thumplo:TSound
+
+ Global thrust_channel:TChannel
+ Global ssaucer_channel:TChannel
+ Global lsaucer_channel:TChannel
+
+ Global frame:Int
+ Global hi:Int
+
+ Function Init()
+ explode=New TSound[3]
+ explode[2]=LoadSound("incbin::SFX/explode1.wav")
+ explode[1]=LoadSound("incbin::SFX/explode2.wav")
+ explode[0]=LoadSound("incbin::SFX/explode3.wav")
+ fire=LoadSound("incbin::SFX/fire.wav")
+ life=LoadSound("incbin::SFX/life.wav")
+ lsaucer=LoadSound("incbin::SFX/lsaucer.wav",True)
+ sfire=LoadSound("incbin::SFX/sfire.wav")
+ ssaucer=LoadSound("incbin::SFX/ssaucer.wav",True)
+ thrust=LoadSound("incbin::SFX/thrust.wav",True)
+ thumplo=LoadSound("incbin::SFX/thumplo.wav")
+ thumphi=LoadSound("incbin::SFX/thumphi.wav")
+
+ frame=0
+ hi=True
+
+ thrust_channel=thrust.Cue()
+ ssaucer_channel=ssaucer.Cue()
+ lsaucer_channel=lsaucer.Cue()
+ End Function
+
+ Function Update(freq:Int)
+ If frame>freq
+ frame=0
+
+ If hi
+ thumphi.Play()
+ Else
+ thumplo.Play()
+ EndIf
+
+ hi=Not hi
+ EndIf
+ frame:+1
+ End Function
+
+ Function AsteroidExplosion(size:Int)
+ explode[size].Play()
+ End Function
+
+ Function ShipExplosion()
+ explode[0].Play()
+ End Function
+
+ Function PlayerFire()
+ fire.Play()
+ End Function
+
+ Function SaucerFire()
+ sfire.Play()
+ End Function
+
+ Function ExtraLife()
+ life.Play()
+ End Function
+
+ Function PlayerThrust(on:Int)
+ thrust_channel.SetPaused(Not on)
+ End Function
+
+ Function SmallSaucer()
+ ssaucer_channel.SetPaused(False)
+ End Function
+
+ Function LargeSaucer()
+ lsaucer_channel.SetPaused(False)
+ End Function
+
+ Function NoSaucer()
+ lsaucer_channel.SetPaused(True)
+ ssaucer_channel.SetPaused(True)
+ End Function
+
+ Function Clear()
+ PlayerThrust(False)
+ NoSaucer()
+ End Function
+End Type