summaryrefslogtreecommitdiff
path: root/hardwire.bmx
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-12-10 01:39:37 +0000
committerIan C <ianc@noddybox.co.uk>2005-12-10 01:39:37 +0000
commit673575b774f8e04dcd6ebf1486d16b8980857142 (patch)
tree1d95a7f8f299ca1e9f51d5ef1c0778cce7f891b9 /hardwire.bmx
parentcf0e1b5f3422dc1adc60b1684591ab0962c441bb (diff)
Development checkin
Diffstat (limited to 'hardwire.bmx')
-rw-r--r--hardwire.bmx104
1 files changed, 84 insertions, 20 deletions
diff --git a/hardwire.bmx b/hardwire.bmx
index d0cea7a..1baa51b 100644
--- a/hardwire.bmx
+++ b/hardwire.bmx
@@ -16,19 +16,6 @@ Import "game.bmx"
Import "particle.bmx"
Import "help.bmx"
-Rem
-TWire.Init()
-For Local t:Int=TWire.CROSS To TWire.BOTTOM_RIGHT
-
- Local w:TWire=TWire.Create(t)
-
- For Local d:Int=TWire.DIR_NONE To TWire.DIR_LEFT
- Print TWire.typename[t] + ": " + TWire.dirname[d] + " -> " + TWire.dirname[w.Traverse(d)]
- Next
-Next
-End
-EndRem
-
' ===================================
' Initialise
' ===================================
@@ -82,6 +69,8 @@ While Not quit
While game.Play()
Wend
+ TFadeScreen.DoFadeOut()
+
GameConfig.Save()
last_score=game.score
@@ -121,7 +110,8 @@ Function Menu()
Local fade:TFadeScreen=TFadeScreen.FadeIn()
Local done:Int=False
- Local menu:TGfxMenu=TGfxMenu.Create(255,0,0,255,255,255,25,bdrop,1)
+ 'Local menu:TGfxMenu=TGfxMenu.Create(255,0,0,255,255,255,25,bdrop,1)
+ Local menu:TGfxMenu=TGfxMenu.Create(255,0,0,255,255,255,15,bdrop,1)
Local sel:Int
Local defkey:Int=0
@@ -148,6 +138,12 @@ Function Menu()
DrawImage(GameGFX.title,0,0)
SetColor(255,255,255)
+?debug
+ If KeyHit(KEY_D)
+ DebugCode()
+ EndIf
+?
+
col:+coli
If col=128 Or col=255
@@ -245,7 +241,10 @@ Function Menu()
Case MENU_RULES
FlushKeys()
Local help:THelp=New THelp
+ TFadeScreen.DoFadeOut()
help.Show()
+ TFadeScreen.DoFadeOut()
+ fade=TFadeScreen.FadeIn()
Case MENU_KEYS
FlushKeys()
defkey=1
@@ -282,13 +281,78 @@ Function Menu()
Flip
Wend
- fade:TFadeScreen=TFadeScreen.FadeOut()
- Local pm:TPixmap=GrabPixmap(0,0,GraphicsWidth(),GraphicsHeight())
+ TFadeScreen.DoFadeOut()
+End Function
+
+
+' ===================================
+' Debug
+' ===================================
+'
+?debug
+Function DebugCreate:TPiece(t:Int)
+ Local p:TPiece=TPiece.CreateSpecific(t)
+ p.x=8
+ p.y=-3
+ Return p
+End Function
+
+Function DebugCode()
+ Local done:Int=False
+ Local gm:TGameMap=New TGameMap
+ Local t:Int=0
+ Local p:TPiece=DebugCreate(t)
- While fade.Fade()
+ While Not done
Cls
- DrawPixmap(pm,0,0)
- fade.Draw()
+
+ gm.Draw()
+
+ p.Draw()
+
+ Local k:Int=-1
+
+ For Local f:Int=0 To 255
+ If KeyHit(f)
+ k=f
+ Continue
+ EndIf
+ Next
+
+ Select k
+ Case KEY_ESCAPE
+ done=True
+
+ Case KEY_0,KEY_1,KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8,KEY_9
+ t=k-KEY_0
+ p=DebugCreate(t)
+
+ Case KEY_LEFT
+ p.x:-1
+
+ Case KEY_RIGHT
+ p.x:+1
+
+ Case KEY_DOWN
+ p.y:+1
+
+ Case KEY_UP
+ p.y:-1
+
+ Case KEY_SPACE
+ p.RotateRight()
+
+ Case KEY_ENTER
+ p.AddToMap(gm)
+ p=DebugCreate(t)
+ End Select
+
+ Particles.Draw()
+ ExplosionParticles.Draw()
+ TextParticles.Draw()
+ Sound.Process()
Flip
Wend
-End Function \ No newline at end of file
+End Function
+?
+