From b847fa6928c5e7b2731f54b362b1772f94508d4c Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 7 Oct 2005 01:19:27 +0000 Subject: Added ship. Idea still doesn't really work! --- game.bmx | 102 +++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 25 deletions(-) (limited to 'game.bmx') diff --git a/game.bmx b/game.bmx index ff6ddfa..fb0ada3 100644 --- a/game.bmx +++ b/game.bmx @@ -19,6 +19,7 @@ Type TGame Const LEVEL_CANCELLED:Int= 4 Field level:TLevel + Field ship:TShip Field mass:TList Field point:TList Field timer:Int @@ -42,13 +43,14 @@ Type TGame o.level=level o.mass=CreateList() o.point=CreateList() - o.level.CreatePlayfield(o.mass,o.point) + o.ship=o.level.CreatePlayfield(o.mass,o.point) + o.mass.AddLast(o.ship) o.timer=o.level.timer o.num=o.point.Count() o.done=LEVEL_NOTOVER o.frame=0 o.placed=0 - o.txtoff=[GameGFX.font.TextWidth("PARTICLES"),GameGFX.font.TextWidth("CAPTURED"),GameGFX.font.TextWidth("TIMER"),GameGFX.font.TextWidth("LEFT")] + o.txtoff=[GameGFX.font.TextWidth("PARTICLES"),GameGFX.font.TextWidth("CAPTURED"),GameGFX.font.TextWidth("TIMER"),GameGFX.font.TextWidth("WAVES")] o.playing=False o.col=0 o.coli=5 @@ -126,26 +128,31 @@ Type TGame GameGFX.font.CentreColoured("Need "+level.winpercent+"% to clear",y,col/2,col,col) y:+yi - Local n:Int=Int(level.placemass) + Local n:Int=Int(level.shipmass) + Local w:Int=Int(level.wavemass) If level.invmass n=-n + w=-w EndIf - If level.maxmass>1 - GameGFX.font.CentreColoured("You can place "+level.maxmass+" masses of " + n + " Newtons",y,col/2,col,col) - Else - GameGFX.font.CentreColoured("You can place 1 mass of " + n + " Newtons",y,col/2,col,col) + GameGFX.font.CentreColoured("Your ship has a mass of " + n + " Newtons",y,col/2,col,col) + y:+yi + + If level.maxwave>1 + GameGFX.font.CentreColoured("You can fire "+level.maxwave+" Gravity Waves of " + w + " Newtons",y,col/2,col,col) + ElseIf level.maxwave=1 + GameGFX.font.CentreColoured("You can fire 1 Gravity Wave of " + w + " Newtons",y,col/2,col,col) EndIf y:+yi - If level.placefriend - GameGFX.font.CentreColoured("PLACED MASSES ARE COLLECTORS!",y,col,col/2,col/2) + If level.wrap + GameGFX.font.CentreColoured("THE UNIVERSE IS WARPED!",y,col,col/2,col/2) y:+yi EndIf y:+yi - GameGFX.font.Centre("Press Left Mouse Button",y) + GameGFX.font.Centre("Press Space",y) y:+yi SetScale(1,1) @@ -155,8 +162,44 @@ Type TGame captured=0 lost=0 - If playing + If playing + If done=LEVEL_NOTOVER + If KeyDown(GameConfig.kleft) + ship.RotateLeft() + EndIf + + If KeyDown(GameConfig.kright) + ship.RotateRight() + EndIf + + If KeyDown(GameConfig.kthrust) + ship.Thrust() + EndIf + + If KeyDown(GameConfig.kreverse) + ship.Reverse() + EndIf + + If KeyHit(GameConfig.kblast) And placed