summaryrefslogtreecommitdiff
path: root/game.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'game.bmx')
-rw-r--r--game.bmx31
1 files changed, 24 insertions, 7 deletions
diff --git a/game.bmx b/game.bmx
index 3556409..710bb24 100644
--- a/game.bmx
+++ b/game.bmx
@@ -15,6 +15,8 @@ Type TGame
Const LEVEL_NOTOVER:Int= 0
Const LEVEL_WON:Int= 1
Const LEVEL_LOST:Int= 2
+ Const LEVEL_FINISHED:Int= 3
+ Const LEVEL_CANCELLED:Int= 4
Field level:TLevel
Field mass:TList
@@ -121,19 +123,20 @@ Type TGame
GameGFX.font.CentreColoured("Need "+level.winpercent+"% to clear",y,col/2,col,col)
y:+yi
+
+ Local n:Int=Int(level.placemass)
+
+ If level.invmass
+ n=-n
+ EndIf
If level.maxmass>1
- GameGFX.font.CentreColoured("You can place only "+level.maxmass+" masses of " + Int(level.placemass) + " Newtons",y,col/2,col,col)
+ GameGFX.font.CentreColoured("You can place "+level.maxmass+" masses of " + n + " Newtons",y,col/2,col,col)
Else
- GameGFX.font.CentreColoured("You can place only 1 mass of " + Int(level.placemass) + " Newtons",y,col/2,col,col)
+ GameGFX.font.CentreColoured("You can place 1 mass of " + n + " Newtons",y,col/2,col,col)
EndIf
y:+yi
- If level.invmass
- GameGFX.font.CentreColoured("PLACED MASSES ARE INVERTED!",y,col,col/2,col/2)
- y:+yi
- EndIf
-
If level.placefriend
GameGFX.font.CentreColoured("PLACED MASSES ARE COLLECTORS!",y,col,col/2,col/2)
y:+yi
@@ -275,6 +278,10 @@ Type TGame
playing=True
EndIf
EndIf
+
+ If KeyHit(KEY_ESCAPE)
+ done=LEVEL_CANCELLED
+ EndIf
Case LEVEL_WON
If final_percent=100
SetScale(4,4)
@@ -291,14 +298,24 @@ Type TGame
SetAlpha(0.7)
GameGFX.font.CentreColoured("LEVEL COMPLETED!",GraphicsHeight()/2+20,255,255,0)
GameGFX.font.CentreColoured("You got the pass mark with "+pass_time+" left on the clock",GraphicsHeight()/2+40,255,255,0)
+ GameGFX.font.Centre("Press the Left Mouse Button",GraphicsHeight()/2+80)
SetScale(1,1)
SetAlpha(1)
+
+ If MouseHit(1)
+ done=LEVEL_FINISHED
+ EndIf
Case LEVEL_LOST
SetScale(2,2)
SetAlpha(0.7)
GameGFX.font.CentreColoured("LEVEL FAILED!",GraphicsHeight()/2+20,255,64,64)
+ GameGFX.font.Centre("Press the Left Mouse Button",GraphicsHeight()/2+60)
SetScale(1,1)
SetAlpha(1)
+
+ If MouseHit(1)
+ done=LEVEL_FINISHED
+ EndIf
EndSelect
Return done