summaryrefslogtreecommitdiff
path: root/gametypes.bmx
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 /gametypes.bmx
parent1c900457e45e70e12a04b2c5b909e0bd9a9d8a3e (diff)
Initial completed version
Diffstat (limited to 'gametypes.bmx')
-rw-r--r--gametypes.bmx20
1 files changed, 18 insertions, 2 deletions
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