summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Default.ppinchbin579 -> 738 bytes
-rw-r--r--GFX/font.bmfbin24420 -> 21036 bytes
-rw-r--r--GFX/gui.bmfbin19840 -> 21036 bytes
-rw-r--r--designer.bmx56
-rw-r--r--game.bmx41
5 files changed, 92 insertions, 5 deletions
diff --git a/Default.ppinch b/Default.ppinch
index bd36d76..7d6fcf9 100644
--- a/Default.ppinch
+++ b/Default.ppinch
Binary files differ
diff --git a/GFX/font.bmf b/GFX/font.bmf
index 38378e6..364f158 100644
--- a/GFX/font.bmf
+++ b/GFX/font.bmf
Binary files differ
diff --git a/GFX/gui.bmf b/GFX/gui.bmf
index 8ef2706..364f158 100644
--- a/GFX/gui.bmf
+++ b/GFX/gui.bmf
Binary files differ
diff --git a/designer.bmx b/designer.bmx
index 0b349a5..9040d63 100644
--- a/designer.bmx
+++ b/designer.bmx
@@ -578,11 +578,20 @@ Function DoDesigner()
Cls
If Designer.grid_check.checked
- SetColor(50,50,128)
For Local x:Int=-400 To 400 Step 20
+ If x=0
+ SetColor(50,50,255)
+ Else
+ SetColor(50,50,128)
+ EndIf
DrawLine(399+x,0,399+x,599)
Next
For Local y:Int=-300 To 300 Step 20
+ If y=0
+ SetColor(50,50,255)
+ Else
+ SetColor(50,50,128)
+ EndIf
DrawLine(0,299+y,799,299+y)
Next
EndIf
@@ -699,6 +708,50 @@ Function TestCallback(w:TWidget)
End Function
Function CheckCallback(w:TWidget)
+ Designer.SaveLevel()
+
+ Local s:String="The following problems were found:"
+ Local ok:Int=True
+ Local m:TList=CreateList()
+ Local p:TList=CreateList()
+
+ Designer.level.CreatePlayfield(m,p)
+
+ If m.Count()+Designer.level.maxmass>MAX_GRAV
+ ok=False
+ s:+"|Too many masses (combining placed and dropped)"
+ EndIf
+
+ Local friends:Int=(Designer.level.placefriend And Designer.level.maxmass>0)
+
+ If Not friends
+ For Local gp:TMass=EachIn m
+ If gp.friend
+ friends=True
+ EndIf
+ Next
+ EndIf
+
+ If Not friends
+ ok=False
+ s:+"|No collector masses (no particles can be captured by player)"
+ EndIf
+
+ If p.Count()>MAX_POINT
+ ok=False
+ s:+"|Too many points (" + p.Count() + " -- maximum is " + MAX_POINT
+ EndIf
+
+ If p.Count()=0
+ ok=False
+ s:+"|No particles to collect!"
+ EndIf
+
+ If Not ok
+ GUINotify(s,GameGFX.pointer)
+ Else
+ GUINotify("Level is valid",GameGFX.pointer)
+ EndIf
End Function
Function LoadCallback(w:TWidget)
@@ -708,6 +761,7 @@ Function LoadCallback(w:TWidget)
Designer.levelset=load
Designer.levelindex=0
Designer.levnum.maxval=Designer.levelset.level.Count()-1
+ Designer.levnum.value=0
Designer.LoadLevel()
EndIf
Catch e:TLevelException
diff --git a/game.bmx b/game.bmx
index c11fbc3..8908235 100644
--- a/game.bmx
+++ b/game.bmx
@@ -32,6 +32,7 @@ Type TGame
Field coli:Int
Field final_percent:Int
+ Field pass_time:Int
Function Create:TGame(level:TLevel)
Local o:TGame=New TGame
@@ -45,11 +46,12 @@ Type TGame
o.done=LEVEL_NOTOVER
o.frame=0
o.placed=0
- o.txtoff=[GameGFX.font.TextWidth("PARTICLES"),GameGFX.font.TextWidth("CAPTURED"),GameGFX.font.TextWidth("TIMER")]
+ o.txtoff=[GameGFX.font.TextWidth("PARTICLES"),GameGFX.font.TextWidth("CAPTURED"),GameGFX.font.TextWidth("TIMER"),GameGFX.font.TextWidth("LEFT")]
o.playing=False
o.col=0
o.coli=5
o.final_percent=0
+ o.pass_time=0
Return o
End Function
@@ -71,7 +73,11 @@ Type TGame
GameGFX.font.CentreColoured("Need "+level.winpercent+"% to clear",y,col/2,col,col)
y:+yi
- GameGFX.font.CentreColoured("You can place "+level.maxmass+" masses",y,col/2,col,col)
+ If level.maxmass>1
+ GameGFX.font.CentreColoured("You can place only "+level.maxmass+" masses",y,col/2,col,col)
+ Else
+ GameGFX.font.CentreColoured("You can place only 1 mass",y,col/2,col,col)
+ EndIf
y:+yi
If level.invmass
@@ -148,6 +154,10 @@ Type TGame
percent=final_percent
Else
percent:Int=Int(Float(captured)/Float(num)*100.0)
+
+ If percent>=level.winpercent And pass_time=0
+ pass_time=timer
+ EndIf
EndIf
If (timer=0 Or num=captured+lost) And done=LEVEL_NOTOVER
@@ -170,6 +180,14 @@ Type TGame
GameGFX.font.DrawColoured(percent+"%",txtoff[1]+210,0,50,255,50)
EndIf
+ GameGFX.font.Draw("LEFT",400,0)
+
+ SetScale(2,2)
+ For Local f:Int=0 Until level.maxmass-placed
+ DrawImage(GameGFX.mass,410+txtoff[3]+f*10,4)
+ Next
+ SetScale(1,1)
+
GameGFX.font.Draw("TIMER",600,0)
If timer>10
@@ -201,13 +219,28 @@ Type TGame
EndIf
EndIf
Case LEVEL_WON
+ If final_percent=100
+ SetScale(4,4)
+ GameGFX.font.CentreColoured("PERFECT!",50,col,255-col,col/2)
+ col:+coli
+
+ If col=255 Or col=0
+ coli=-coli
+ EndIf
+ EndIf
+
SetScale(2,2)
- GameGFX.font.CentreColoured("LEVEL COMPLETED!",GraphicsHeight()/2,255,255,0)
+ 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)
SetScale(1,1)
+ SetAlpha(1)
Case LEVEL_LOST
SetScale(2,2)
- GameGFX.font.CentreColoured("LEVEL FAILED!",GraphicsHeight()/2,255,64,64)
+ SetAlpha(0.7)
+ GameGFX.font.CentreColoured("LEVEL FAILED!",GraphicsHeight()/2+20,255,64,64)
SetScale(1,1)
+ SetAlpha(1)
EndSelect
Return done