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 --- SFX/alert.ogg | Bin 0 -> 44415 bytes SFX/alert.xml | 1 + SFX/missile_explode.ogg | Bin 0 -> 29164 bytes SFX/missile_explode.xml | 1 + SFX/missile_launch.ogg | Bin 0 -> 30443 bytes SFX/missile_launch.xml | 1 + SFX/ship_explode.ogg | Bin 0 -> 75524 bytes SFX/ship_explode.xml | 1 + SFX/ship_hit.ogg | Bin 0 -> 33147 bytes SFX/ship_hit.xml | 1 + gametypes.bmx | 20 +++++++++++-- missile_lock.bmx | 44 ++++++++++++++++++++++++++-- sound.bmx | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 SFX/alert.ogg create mode 100644 SFX/alert.xml create mode 100644 SFX/missile_explode.ogg create mode 100644 SFX/missile_explode.xml create mode 100644 SFX/missile_launch.ogg create mode 100644 SFX/missile_launch.xml create mode 100644 SFX/ship_explode.ogg create mode 100644 SFX/ship_explode.xml create mode 100644 SFX/ship_hit.ogg create mode 100644 SFX/ship_hit.xml create mode 100644 sound.bmx diff --git a/SFX/alert.ogg b/SFX/alert.ogg new file mode 100644 index 0000000..05631ed Binary files /dev/null and b/SFX/alert.ogg 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 @@ +Sine100010001E:\Src\BlitzMAX\MissileLock\SFX\alert.wavTrueTriangle5412000False \ 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 Binary files /dev/null and b/SFX/missile_explode.ogg 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 @@ +Noise10001000.7E:\Src\BlitzMAX\MissileLock\SFX\missile_explode.wavTrue1500False1500False \ 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 Binary files /dev/null and b/SFX/missile_launch.ogg 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 @@ +Noise5001000.7E:\Src\BlitzMAX\MissileLock\SFX\missile_launch.wavTrueSine20150501500False \ 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 Binary files /dev/null and b/SFX/ship_explode.ogg 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 @@ +Noise5001000.7E:\Src\BlitzMAX\MissileLock\SFX\ship_explode.wavTrue333501500False1500False33350 \ 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 Binary files /dev/null and b/SFX/ship_hit.ogg 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 @@ +Square5005000.5E:\Src\BlitzMAX\MissileLock\SFX\ship_hit.wavTrueNoise50000.513350200False \ 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