summaryrefslogtreecommitdiff
path: root/hardwire.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'hardwire.bmx')
-rw-r--r--hardwire.bmx54
1 files changed, 49 insertions, 5 deletions
diff --git a/hardwire.bmx b/hardwire.bmx
index 79509b2..d0cea7a 100644
--- a/hardwire.bmx
+++ b/hardwire.bmx
@@ -14,6 +14,7 @@ Import "types.bmx"
Import "gametypes.bmx"
Import "game.bmx"
Import "particle.bmx"
+Import "help.bmx"
Rem
TWire.Init()
@@ -53,16 +54,19 @@ SetAlpha(1.0)
' Globals
' ===================================
'
-GameGFX.Init()
+GameGFX.Init() ' MUST be first
+
Lookup.Init()
GameConfig.Load()
TWire.Init()
Particles.Init()
TextParticles.Init()
+ExplosionParticles.Init()
Sound.Init()
Global bdrop:TMenuBdrop=New TMenuBdrop
Global quit:Int=False
+Global last_score:Int=0
' ===================================
@@ -78,6 +82,9 @@ While Not quit
While game.Play()
Wend
+ GameConfig.Save()
+ last_score=game.score
+
Menu()
Wend
@@ -107,13 +114,14 @@ End Function
Function Menu()
Const MENU_PLAY:Int=1
Const MENU_QUIT:Int=2
- Const MENU_SCORES:Int=3
+ Const MENU_RULES:Int=3
Const MENU_KEYS:Int=4
Const MENU_LEFT:Int=5
Const MENU_RIGHT:Int=6
+ Local fade:TFadeScreen=TFadeScreen.FadeIn()
Local done:Int=False
- Local menu:TGfxMenu=TGfxMenu.Create(200,0,0,255,255,255,25,bdrop,1)
+ Local menu:TGfxMenu=TGfxMenu.Create(255,0,0,255,255,255,25,bdrop,1)
Local sel:Int
Local defkey:Int=0
@@ -122,7 +130,7 @@ Function Menu()
Local x2:Int=GraphicsWidth()/3*2-ImageWidth(GameGFX.play_button)/2
menu.Add(x1,150,GameGFX.play_button,MENU_PLAY)
- menu.Add(x2,150,GameGFX.scores_button,MENU_SCORES)
+ menu.Add(x2,150,GameGFX.rules_button,MENU_RULES)
menu.Add(x1,250,GameGFX.keys_button,MENU_KEYS)
menu.Add(x2,250,GameGFX.quit_button,MENU_QUIT)
menu.Add(x1,350,GameGFX.left_button,MENU_LEFT)
@@ -131,9 +139,20 @@ Function Menu()
Local tx1:Int=(GraphicsWidth()-GameGFX.large.TextWidth("START LEVEL 1"))/2
Local tx2:Int=tx1+GameGFX.large.TextWidth("START LEVEL ")
+ Local col:Int=128
+ Local coli=1
+
While Not done
Cls
+ SetColor(col,col,255)
DrawImage(GameGFX.title,0,0)
+ SetColor(255,255,255)
+
+ col:+coli
+
+ If col=128 Or col=255
+ coli=-coli
+ EndIf
sel=menu.Render(defkey>0)
@@ -212,14 +231,21 @@ Function Menu()
GameGFX.large.Draw("START LEVEL ",tx1,356)
GameGFX.large.Draw(GameConfig.start_level,tx2,356,255,255,0)
+
+ GameGFX.large.CentreOn("LAST SCORE",200,500)
+ GameGFX.large.CentreOn("HIGH SCORE",600,500)
+ GameGFX.large.CentreOn(last_score,200,520,255,255,0)
+ GameGFX.large.CentreOn(GameConfig.hiscore,600,520,255,255,0)
EndIf
Select sel
Case MENU_PLAY
done=True
FlushKeys()
- Case MENU_SCORES
+ Case MENU_RULES
FlushKeys()
+ Local help:THelp=New THelp
+ help.Show()
Case MENU_KEYS
FlushKeys()
defkey=1
@@ -245,6 +271,24 @@ Function Menu()
SetColor(255,255,255)
DrawImage(GameGFX.pointer,MouseX(),MouseY())
+ If fade
+ If fade.Fade()
+ fade.Draw()
+ Else
+ fade=Null
+ EndIf
+ EndIf
+
+ Flip
+ Wend
+
+ fade:TFadeScreen=TFadeScreen.FadeOut()
+ Local pm:TPixmap=GrabPixmap(0,0,GraphicsWidth(),GraphicsHeight())
+
+ While fade.Fade()
+ Cls
+ DrawPixmap(pm,0,0)
+ fade.Draw()
Flip
Wend
End Function \ No newline at end of file