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 --- gametypes.bmx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gametypes.bmx') 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 -- cgit v1.2.3