summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-06-03 10:52:37 +0000
committerIan C <ianc@noddybox.co.uk>2006-06-03 10:52:37 +0000
commit6f5a1164f31d4e5594f5a6ce8de328f3b0608fd8 (patch)
treef00fccd0320a7adff758ff90c759ea5971e1331e
parent1c900457e45e70e12a04b2c5b909e0bd9a9d8a3e (diff)
Initial completed version
-rw-r--r--SFX/alert.oggbin0 -> 44415 bytes
-rw-r--r--SFX/alert.xml1
-rw-r--r--SFX/missile_explode.oggbin0 -> 29164 bytes
-rw-r--r--SFX/missile_explode.xml1
-rw-r--r--SFX/missile_launch.oggbin0 -> 30443 bytes
-rw-r--r--SFX/missile_launch.xml1
-rw-r--r--SFX/ship_explode.oggbin0 -> 75524 bytes
-rw-r--r--SFX/ship_explode.xml1
-rw-r--r--SFX/ship_hit.oggbin0 -> 33147 bytes
-rw-r--r--SFX/ship_hit.xml1
-rw-r--r--gametypes.bmx20
-rw-r--r--missile_lock.bmx44
-rw-r--r--sound.bmx75
13 files changed, 140 insertions, 4 deletions
diff --git a/SFX/alert.ogg b/SFX/alert.ogg
new file mode 100644
index 0000000..05631ed
--- /dev/null
+++ b/SFX/alert.ogg
Binary files differ
diff --git a/SFX/alert.xml b/SFX/alert.xml
new file mode 100644
index 0000000..3b16eea
--- /dev/null
+++ b/SFX/alert.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><SFX version="1.0" msec="2000"><Device x="170" y="53" name="Wave 1"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="290b4cfc-5311-4a8b-b8ce-5d367280c19b" name="Wave 1"><Wave>Sine</Wave><Base>1000</Base><Adj>1000</Adj><Ampl>1</Ampl></SFXComponent></Device><Device x="513" y="117" name="WAV 2"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WAVWriter" guid="c87ca5ac-d0e0-4782-b198-ca5acf283789" name="WAV 2"><File>E:\Src\BlitzMAX\MissileLock\SFX\alert.wav</File><Preview>True</Preview></SFXComponent></Device><Device x="27" y="78" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="0b66713f-875a-4f7d-87db-0530d9af9793" name="No name"><Wave>Triangle</Wave><Base>5</Base><Adj>4</Adj><Ampl>1</Ampl></SFXComponent></Device><Device x="408" y="117" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Splitter" guid="a316d28d-8bdf-425a-92b6-8a73be20cad2" name="No name"><!--No internal data--></SFXComponent></Device><Device x="128" y="201" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="2fe86db9-083e-4eb9-9f34-0954b5dff12d" name="No name"><Period>2000</Period><Repeat>False</Repeat><Point x="0" y="0" /><Point x="0.0539772727272727" y="1" /><Point x="0.944602272727273" y="1" /><Point x="1" y="0" /></SFXComponent></Device><Device x="291" y="116" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Multiplier" guid="cd41e42a-8466-4ca4-bc3c-f538bf07e6a6" name="No name"><!--No internal data--></SFXComponent></Device><Wire input_guid="a316d28d-8bdf-425a-92b6-8a73be20cad2" input_connection="OUT1" output_guid="c87ca5ac-d0e0-4782-b198-ca5acf283789" output_connection="L" /><Wire input_guid="a316d28d-8bdf-425a-92b6-8a73be20cad2" input_connection="OUT2" output_guid="c87ca5ac-d0e0-4782-b198-ca5acf283789" output_connection="R" /><Wire input_guid="0b66713f-875a-4f7d-87db-0530d9af9793" input_connection="WAVE" output_guid="290b4cfc-5311-4a8b-b8ce-5d367280c19b" output_connection="ADJ" /><Wire input_guid="0b66713f-875a-4f7d-87db-0530d9af9793" input_connection="DUP1" output_guid="0b66713f-875a-4f7d-87db-0530d9af9793" output_connection="ADJ" /><Wire input_guid="290b4cfc-5311-4a8b-b8ce-5d367280c19b" input_connection="WAVE" output_guid="cd41e42a-8466-4ca4-bc3c-f538bf07e6a6" output_connection="A" /><Wire input_guid="cd41e42a-8466-4ca4-bc3c-f538bf07e6a6" input_connection="OUT1" output_guid="a316d28d-8bdf-425a-92b6-8a73be20cad2" output_connection="IN" /><Wire input_guid="2fe86db9-083e-4eb9-9f34-0954b5dff12d" input_connection="ENV" output_guid="cd41e42a-8466-4ca4-bc3c-f538bf07e6a6" output_connection="B" /></SFX> \ No newline at end of file
diff --git a/SFX/missile_explode.ogg b/SFX/missile_explode.ogg
new file mode 100644
index 0000000..13800b6
--- /dev/null
+++ b/SFX/missile_explode.ogg
Binary files differ
diff --git a/SFX/missile_explode.xml b/SFX/missile_explode.xml
new file mode 100644
index 0000000..3e00d47
--- /dev/null
+++ b/SFX/missile_explode.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><SFX version="1.0" msec="1500"><Device x="47" y="32" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" name="No name"><Wave>Noise</Wave><Base>1000</Base><Adj>100</Adj><Ampl>0.7</Ampl></SFXComponent></Device><Device x="559" y="105" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WAVWriter" guid="de1dded5-4ced-401b-81c6-03f8b248afe0" name="No name"><File>E:\Src\BlitzMAX\MissileLock\SFX\missile_explode.wav</File><Preview>True</Preview></SFXComponent></Device><Device x="47" y="152" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" name="No name"><Period>1500</Period><Repeat>False</Repeat><Point x="0" y="0" /><Point x="0.0596590909090909" y="1" /><Point x="0.264204545454545" y="1" /><Point x="0.4375" y="0.573170731707317" /><Point x="0.745738636363636" y="1" /><Point x="1" y="0" /></SFXComponent></Device><Device x="320" y="102" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Multiplier" guid="6524c626-8395-4c16-bf66-6aefc2663a8f" name="No name"><!--No internal data--></SFXComponent></Device><Device x="442" y="104" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Pan" guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" name="No name"><!--No internal data--></SFXComponent></Device><Device x="252" y="234" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="d5fe5faf-637e-4833-86c5-8c3b1250f9cd" name="No name"><Period>1500</Period><Repeat>False</Repeat><Point x="0" y="-1" /><Point x="0.488636363636364" y="1" /><Point x="0.488636363636364" y="-1" /><Point x="1" y="1" /><Point x="1" y="0" /></SFXComponent></Device><Wire input_guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" input_connection="ENV" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="B" /><Wire input_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" input_connection="OUT1" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="IN" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="R" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="R" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="L" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="L" /><Wire input_guid="d5fe5faf-637e-4833-86c5-8c3b1250f9cd" input_connection="ENV" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="POS" /><Wire input_guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" input_connection="WAVE" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="A" /></SFX> \ No newline at end of file
diff --git a/SFX/missile_launch.ogg b/SFX/missile_launch.ogg
new file mode 100644
index 0000000..c8df1c3
--- /dev/null
+++ b/SFX/missile_launch.ogg
Binary files differ
diff --git a/SFX/missile_launch.xml b/SFX/missile_launch.xml
new file mode 100644
index 0000000..936d495
--- /dev/null
+++ b/SFX/missile_launch.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><SFX version="1.0" msec="1500"><Device x="47" y="32" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" name="No name"><Wave>Noise</Wave><Base>500</Base><Adj>100</Adj><Ampl>0.7</Ampl></SFXComponent></Device><Device x="671" y="105" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WAVWriter" guid="de1dded5-4ced-401b-81c6-03f8b248afe0" name="No name"><File>E:\Src\BlitzMAX\MissileLock\SFX\missile_launch.wav</File><Preview>True</Preview></SFXComponent></Device><Device x="275" y="241" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="fa9eaeaa-1da0-44e0-9347-ce0481d9eef3" name="No name"><Wave>Sine</Wave><Base>2</Base><Adj>0</Adj><Ampl>1</Ampl></SFXComponent></Device><Device x="533" y="303" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Delay" guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" name="No name"><Delay>50</Delay><Feedback>50</Feedback></SFXComponent></Device><Device x="47" y="152" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" name="No name"><Period>1500</Period><Repeat>False</Repeat><Point x="0" y="0" /><Point x="0.139204545454545" y="0.646341463414634" /><Point x="0.578125" y="0.420731707317073" /><Point x="1" y="0" /></SFXComponent></Device><Device x="320" y="102" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Multiplier" guid="6524c626-8395-4c16-bf66-6aefc2663a8f" name="No name"><!--No internal data--></SFXComponent></Device><Device x="444" y="104" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Pan" guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" name="No name"><!--No internal data--></SFXComponent></Device><Wire input_guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" input_connection="ENV" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="B" /><Wire input_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" input_connection="OUT1" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="IN" /><Wire input_guid="fa9eaeaa-1da0-44e0-9347-ce0481d9eef3" input_connection="WAVE" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="POS" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="R" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="R" /><Wire input_guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" input_connection="WAVE" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="A" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="L" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="L" /></SFX> \ No newline at end of file
diff --git a/SFX/ship_explode.ogg b/SFX/ship_explode.ogg
new file mode 100644
index 0000000..2166d83
--- /dev/null
+++ b/SFX/ship_explode.ogg
Binary files differ
diff --git a/SFX/ship_explode.xml b/SFX/ship_explode.xml
new file mode 100644
index 0000000..9893598
--- /dev/null
+++ b/SFX/ship_explode.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><SFX version="1.0" msec="4000"><Device x="47" y="32" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" name="No name"><Wave>Noise</Wave><Base>500</Base><Adj>100</Adj><Ampl>0.7</Ampl></SFXComponent></Device><Device x="678" y="100" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WAVWriter" guid="de1dded5-4ced-401b-81c6-03f8b248afe0" name="No name"><File>E:\Src\BlitzMAX\MissileLock\SFX\ship_explode.wav</File><Preview>True</Preview></SFXComponent></Device><Device x="554" y="81" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Delay" guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" name="No name"><Delay>333</Delay><Feedback>50</Feedback></SFXComponent></Device><Device x="47" y="152" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" name="No name"><Period>1500</Period><Repeat>False</Repeat><Point x="0" y="0" /><Point x="0.0596590909090909" y="1" /><Point x="0.264204545454545" y="1" /><Point x="0.4375" y="0.573170731707317" /><Point x="0.745738636363636" y="1" /><Point x="1" y="0" /></SFXComponent></Device><Device x="320" y="102" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Multiplier" guid="6524c626-8395-4c16-bf66-6aefc2663a8f" name="No name"><!--No internal data--></SFXComponent></Device><Device x="442" y="104" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Pan" guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" name="No name"><!--No internal data--></SFXComponent></Device><Device x="252" y="234" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="d5fe5faf-637e-4833-86c5-8c3b1250f9cd" name="No name"><Period>1500</Period><Repeat>False</Repeat><Point x="0" y="-1" /><Point x="1" y="1" /><Point x="1" y="0" /></SFXComponent></Device><Device x="553" y="180" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Delay" guid="0c24cca1-75ab-4514-a415-bbf2a8d02acc" name="No name"><Delay>333</Delay><Feedback>50</Feedback></SFXComponent></Device><Wire input_guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" input_connection="ENV" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="B" /><Wire input_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" input_connection="OUT1" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="IN" /><Wire input_guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" input_connection="WAVE" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="A" /><Wire input_guid="d5fe5faf-637e-4833-86c5-8c3b1250f9cd" input_connection="ENV" output_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" output_connection="POS" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="R" output_guid="0c24cca1-75ab-4514-a415-bbf2a8d02acc" output_connection="IN" /><Wire input_guid="f7d4a5b9-cd69-4f4c-af7b-899d4898ac7a" input_connection="L" output_guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" output_connection="IN" /><Wire input_guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" input_connection="OUT" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="L" /><Wire input_guid="0c24cca1-75ab-4514-a415-bbf2a8d02acc" input_connection="OUT" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="R" /></SFX> \ No newline at end of file
diff --git a/SFX/ship_hit.ogg b/SFX/ship_hit.ogg
new file mode 100644
index 0000000..95e866d
--- /dev/null
+++ b/SFX/ship_hit.ogg
Binary files differ
diff --git a/SFX/ship_hit.xml b/SFX/ship_hit.xml
new file mode 100644
index 0000000..0c6db78
--- /dev/null
+++ b/SFX/ship_hit.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><SFX version="1.0" msec="2000"><Device x="51" y="0" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" name="No name"><Wave>Square</Wave><Base>500</Base><Adj>500</Adj><Ampl>0.5</Ampl></SFXComponent></Device><Device x="671" y="105" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WAVWriter" guid="de1dded5-4ced-401b-81c6-03f8b248afe0" name="No name"><File>E:\Src\BlitzMAX\MissileLock\SFX\ship_hit.wav</File><Preview>True</Preview></SFXComponent></Device><Device x="51" y="101" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.WaveGenerator" guid="fa9eaeaa-1da0-44e0-9347-ce0481d9eef3" name="No name"><Wave>Noise</Wave><Base>500</Base><Adj>0</Adj><Ampl>0.5</Ampl></SFXComponent></Device><Device x="469" y="102" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Delay" guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" name="No name"><Delay>133</Delay><Feedback>50</Feedback></SFXComponent></Device><Device x="183" y="220" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Envelope" guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" name="No name"><Period>200</Period><Repeat>False</Repeat><Point x="0" y="0" /><Point x="0.142045454545455" y="1" /><Point x="0.580965909090909" y="0.817073170731707" /><Point x="1" y="0" /></SFXComponent></Device><Device x="320" y="102" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Multiplier" guid="6524c626-8395-4c16-bf66-6aefc2663a8f" name="No name"><!--No internal data--></SFXComponent></Device><Device x="180" y="53" name="No name"><SFXComponent assembly="SFXGenBaseModules.dll" type="SFXGenBaseModules.Adder" guid="8b2b0666-8119-4f43-a7b7-cc2d17571bbd" name="No name"><!--No internal data--></SFXComponent></Device><Wire input_guid="ae23195b-ab85-4686-9818-7acf1f2c0ba6" input_connection="ENV" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="B" /><Wire input_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" input_connection="OUT1" output_guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" output_connection="IN" /><Wire input_guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" input_connection="OUT" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="L" /><Wire input_guid="aeaa9699-a9be-4209-bc01-8c01a87590e0" input_connection="DUP1" output_guid="de1dded5-4ced-401b-81c6-03f8b248afe0" output_connection="R" /><Wire input_guid="52e9a8a8-e529-4aff-93d8-d96a69fc720a" input_connection="WAVE" output_guid="8b2b0666-8119-4f43-a7b7-cc2d17571bbd" output_connection="A" /><Wire input_guid="fa9eaeaa-1da0-44e0-9347-ce0481d9eef3" input_connection="WAVE" output_guid="8b2b0666-8119-4f43-a7b7-cc2d17571bbd" output_connection="B" /><Wire input_guid="8b2b0666-8119-4f43-a7b7-cc2d17571bbd" input_connection="OUT1" output_guid="6524c626-8395-4c16-bf66-6aefc2663a8f" output_connection="A" /></SFX> \ No newline at end of file
diff --git a/gametypes.bmx b/gametypes.bmx
index f5d3bf9..a89c366 100644
--- a/gametypes.bmx
+++ b/gametypes.bmx
@@ -24,6 +24,7 @@ Strict
Import noddybox.algorithm
Import "global.bmx"
Import "particle.bmx"
+Import "sound.bmx"
Const SHIP_TURN:Double=2
Const SHIP_MAX_SPEED:Double=2.5
@@ -50,6 +51,8 @@ Type GameState
Global game_over:Int=False
Global hit:Int=False
Global pause:Int=False
+ Global bonus_timer:Int
+ Global gonads:Int
Function Reset()
score=0
@@ -65,14 +68,20 @@ Type GameState
End Function
Function ShieldShip()
- shield=5*HERTZ
+ shield=3*HERTZ
End Function
Function ShieldDown()
lives:-1
hit=True
+ gonads=False
ShieldShip()
- If lives<0 Then game_over=True
+ If lives<0
+ game_over=True
+ SFX.ShipExplode()
+ Else
+ SFX.ShipHit()
+ EndIf
End Function
Function AddScore(s:Int)
@@ -89,9 +98,11 @@ Type GameState
Function SetLevel(l:Int)
level=l
hit=False
+ gonads=True
max_missile=Min(50,l*2)
missile_turn=Min(MAX_TURN,MIN_TURN+Double(level)/4)
missile_speed=Min(MAX_SPEED,MIN_SPEED+Double(level)/4)
+ bonus_timer=l*500
End Function
Function Control()
@@ -105,6 +116,7 @@ Type GameState
If KeyDown(GameConfig.kthrust) And speed<=SHIP_MAX_SPEED
speed=Min(SHIP_MAX_SPEED,speed+SHIP_SPEED)
+ gonads=False
Else
speed=Max(SHIP_MIN_SPEED,speed-SHIP_SPEED/2)
End If
@@ -125,6 +137,7 @@ Type GameState
If y<0 Then y:+600
Trail.Add()
If shield Then shield:-1
+ If bonus_timer Then bonus_timer:-1
End Function
Function Display()
@@ -141,6 +154,7 @@ Type GameState
GFX.font.Centre(s,16)
GFX.font.Draw("LEVEL " + level,0,584)
+ GFX.font.Draw("BONUS " + bonus_timer,350,584)
GFX.font.Draw("MISSILES " + MissileSet.Count(),623,584)
GFX.font.DrawRight("HISCORE",799,0)
@@ -353,6 +367,7 @@ Type MissileSet
If create
plist.AddLast(New Missile)
create:-1
+ SFX.MissileLaunch()
EndIf
wait=HERTZ
Else
@@ -428,6 +443,7 @@ Type Asteroid
Particles.AddBigExplosion(x,y)
GameState.AddScore(10*GameState.level)
MissileSet.RemoveMissile(Missile(o[0]))
+ SFX.MissileExplode()
Return False
Else
Return True
diff --git a/missile_lock.bmx b/missile_lock.bmx
index b2b7bea..0bcd87e 100644
--- a/missile_lock.bmx
+++ b/missile_lock.bmx
@@ -36,6 +36,7 @@ Import "gametypes.bmx"
'Import "game.bmx"
Import "particle.bmx"
'Import "help.bmx"
+Import "sound.bmx"
' ===================================
' Initialise
@@ -63,6 +64,7 @@ SetAlpha(1.0)
' ===================================
'
GFX.Init() ' MUST be first
+SFX.Init()
GameConfig.Load()
Scroller.Init()
@@ -82,6 +84,8 @@ Global quit:Int=False
'
Menu()
+FlushKeys()
+
While Not quit
GameState.Reset()
'GameState.SetLevel(10)
@@ -90,8 +94,20 @@ While Not quit
While Not GameState.game_over
+ Local alert_timer:Int=200
+
+ SFX.Alert()
+
While Not GameState.game_over And Not MissileSet.AllDestroyed()
Cls()
+
+ If alert_timer
+ alert_timer:-1
+ If alert_timer Mod 60 < 30
+ GFX.font.Centre("RED ALERT!",300,255,0,0)
+ EndIf
+ EndIf
+
ResetCollisions()
Backdrop.Draw()
@@ -151,11 +167,23 @@ While Not quit
Local bonus=100*GameState.level
Local added:Int=0
Local timer:Int=Max(HERTZ*5,bonus/10+HERTZ*3)
+ Local bt:Int=0
+
+ If GameState.gonads
+ GameState.AddScore(9999+(GameState.level-1)*10000)
+ EndIf
If Not GameState.hit
GameState.AddScore(500*GameState.level)
EndIf
+ If GameState.bonus_timer
+ bonus:+GameState.bonus_timer
+ bt=GameState.bonus_timer
+ EndIf
+
+ GameState.bonus_timer=0
+
While timer And Not KeyHit(KEY_ESCAPE)
Cls()
ResetCollisions()
@@ -184,8 +212,20 @@ While Not quit
GFX.font.Centre("BONUS " + Number.Format(added) + "!!!",400,255,255,0)
+ If bt
+ GFX.font.Centre("TIMER BONUS " + bt + "!!!",420,255,255,0)
+ EndIf
+
+ Local y:Int=440
+
If Not GameState.hit
- GFX.font.Centre("PERFECT BONUS " + (500*GameState.level) + "!!!",420,255,255,0)
+ GFX.font.Centre("PERFECT BONUS " + (500*GameState.level) + "!!!",y,255,255,0)
+ y:+20
+ EndIf
+
+ If GameState.gonads
+ GFX.font.Centre("SECRET GONADS OF STEEL BONUS " + (9999+(GameState.level-1)*10000) + "!!!",y,255,255,0)
+ y:+20
EndIf
If added<bonus
@@ -375,7 +415,7 @@ Function Menu()
GFX.font.Centre("THANKS TO",300)
Thanks.Draw(326)
- GFX.font.Centre("PRESS THRUST TO PLAY",400)
+ GFX.font.Centre("PRESS " + KeySym(GameConfig.kthrust).ToUpper() + " TO PLAY",400)
GFX.font.Centre("PRESS R TO REDEFINE KEYS",480)
GFX.font.Centre("PRESS ESCAPE TO QUIT",500)
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
+