summaryrefslogtreecommitdiff
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
parentcf0e1b5f3422dc1adc60b1684591ab0962c441bb (diff)
Development checkin
-rw-r--r--HELP/bomb.pngbin1495 -> 1913 bytes
-rw-r--r--HELP/cross.pngbin0 -> 2838 bytes
-rw-r--r--HELP/help.txt23
-rw-r--r--HELP/nuke.pngbin0 -> 2748 bytes
-rw-r--r--HELP/twister.pngbin1833 -> 2522 bytes
-rw-r--r--TILES/special_cross.pngbin0 -> 489 bytes
-rw-r--r--TILES/special_nuke.pngbin0 -> 685 bytes
-rw-r--r--TILES/tiles.bmsbin98831 -> 131704 bytes
-rw-r--r--game.bmx83
-rw-r--r--gametypes.bmx191
-rw-r--r--hardwire.bmx104
-rw-r--r--help.bmx86
-rw-r--r--types.bmx83
13 files changed, 462 insertions, 108 deletions
diff --git a/HELP/bomb.png b/HELP/bomb.png
index 0bb3eed..a7b0f41 100644
--- a/HELP/bomb.png
+++ b/HELP/bomb.png
Binary files differ
diff --git a/HELP/cross.png b/HELP/cross.png
new file mode 100644
index 0000000..41425ff
--- /dev/null
+++ b/HELP/cross.png
Binary files differ
diff --git a/HELP/help.txt b/HELP/help.txt
index ef89506..0d98d52 100644
--- a/HELP/help.txt
+++ b/HELP/help.txt
@@ -44,21 +44,38 @@ Once in a while a special piece may drop down...
!SMART BOMB
-#incbin::HELP/bomb.png
+$incbin::HELP/bomb.png
This special will destroy all blocks that are the
same as the one it lands on. Landing on nothing
-is probably not a good idea...
+is perhaps not a good idea...
!TWISTER
-#incbin::HELP/twister.png
+$incbin::HELP/twister.png
The twister will rotate all the pieces in the pit
four times, scoring any loops and wires that
are made from doing this.
+!SMART NUKE
+
+$incbin::HELP/nuke.png
+
+The smart nuke destroy all blocks that match
+the blocks surrounding the point were it lands.
+
+
+!SUPER CROSS
+
+~incbin::HELP/cross.png
+
+This will change all blocks above, below and to
+the left and right radiating out from the
+special to cross pieces.
+
+
* * * * * * * * * * * * *
diff --git a/HELP/nuke.png b/HELP/nuke.png
new file mode 100644
index 0000000..ce2930a
--- /dev/null
+++ b/HELP/nuke.png
Binary files differ
diff --git a/HELP/twister.png b/HELP/twister.png
index 61b3e40..866d25c 100644
--- a/HELP/twister.png
+++ b/HELP/twister.png
Binary files differ
diff --git a/TILES/special_cross.png b/TILES/special_cross.png
new file mode 100644
index 0000000..c90b469
--- /dev/null
+++ b/TILES/special_cross.png
Binary files differ
diff --git a/TILES/special_nuke.png b/TILES/special_nuke.png
new file mode 100644
index 0000000..f13a3f5
--- /dev/null
+++ b/TILES/special_nuke.png
Binary files differ
diff --git a/TILES/tiles.bms b/TILES/tiles.bms
index 4244143..b4ae1c2 100644
--- a/TILES/tiles.bms
+++ b/TILES/tiles.bms
Binary files differ
diff --git a/game.bmx b/game.bmx
index 64bf2d5..d07d1a3 100644
--- a/game.bmx
+++ b/game.bmx
@@ -10,6 +10,59 @@ Import "particle.bmx"
Import "sounds.bmx"
Import "gametypes.bmx"
+Type TBufferedKey
+ Global list:TList
+ Field key:Int
+ Field del:Int
+ Field cnt:Int
+
+ Function Clear()
+ list=CreateList()
+ End Function
+
+ Function Create:TBufferedKey(key:Int, del:Int=30)
+ Local o:TBufferedKey=New TBufferedKey
+ o.key=key
+ o.del=del
+ o.cnt=0
+ list.AddLast(o)
+ Return o
+ End Function
+
+ Function Flush()
+ For Local k:TBufferedKey=EachIn list
+ k.cnt=0
+ Next
+ End Function
+
+ Function Idle()
+ For Local k:TBufferedKey=EachIn list
+ If k.cnt
+ k.cnt:-1
+ EndIf
+ Next
+ End Function
+
+ Method ForceRelease()
+ cnt=999999
+ End Method
+
+ Method Poll:Int()
+ If KeyDown(key)
+ If cnt
+ cnt:-1
+ Return False
+ Else
+ cnt=del
+ Return True
+ EndIf
+ Else
+ cnt=0
+ Return False
+ EndIf
+ End Method
+End Type
+
Type TGame
Field level:Int
Field score:Int
@@ -24,6 +77,11 @@ Type TGame
Field drop:Int
Field fade:TFadeScreen
Field bdrop:TGameBackdrop
+ Field kleft:TBufferedKey
+ Field kright:TBufferedKey
+ Field krotleft:TBufferedKey
+ Field krotright:TBufferedKey
+ Field kdrop:TBufferedKey
Method New()
score=0
@@ -41,6 +99,13 @@ Type TGame
CreateNext(False)
fade=TFadeScreen.FadeIn()
bdrop=New TGameBackdrop
+
+ TBufferedKey.Clear()
+ kleft=TBufferedKey.Create(GameConfig.kleft)
+ kright=TBufferedKey.Create(GameConfig.kright)
+ krotleft=TBufferedKey.Create(GameConfig.krotleft)
+ krotright=TBufferedKey.Create(GameConfig.krotright)
+ kdrop=TBufferedKey.Create(GameConfig.kdrop,1)
End Method
Method SetInitLevel(l:Int)
@@ -117,6 +182,7 @@ Type TGame
SetScale(1,1)
FlushKeys
+ TBufferedKey.Flush()
End Method
Method Play:Int()
@@ -163,30 +229,33 @@ Type TGame
LevelUp()
EndIf
+ kdrop.ForceRelease()
+
If Not gm.overflow
score:+level*2
- CreateNext((total Mod 15)=0) ' 15
+ CreateNext((total Mod 17)=0) ' 17
Else
FlushKeys()
+ TBufferedKey.Flush()
EndIf
EndIf
EndIf
- If KeyHit(GameConfig.kleft)
+ If kleft.Poll()
block.x:-1
If block.Collides(gm)
block.x:+1
EndIf
EndIf
- If KeyHit(GameConfig.kright)
+ If kright.Poll()
block.x:+1
If block.Collides(gm)
block.x:-1
EndIf
EndIf
- If KeyHit(GameConfig.krotright)
+ If krotright.Poll()
block.RotateRight()
If block.Collides(gm)
block.x:-1
@@ -197,7 +266,7 @@ Type TGame
EndIf
EndIf
- If KeyHit(GameConfig.krotleft)
+ If krotleft.Poll()
block.RotateLeft()
If block.Collides(gm)
block.x:+1
@@ -208,10 +277,12 @@ Type TGame
EndIf
EndIf
- If KeyDown(GameConfig.kdrop)
+ If kdrop.Poll()
timer=0
'drop=True
EndIf
+ Else
+ TBufferedKey.Idle()
EndIf
score:+gm.Draw()*level*20
diff --git a/gametypes.bmx b/gametypes.bmx
index 7c60b71..772b9e3 100644
--- a/gametypes.bmx
+++ b/gametypes.bmx
@@ -32,6 +32,8 @@ Type TWire
Const BOTTOM_RIGHT:Int=6
Const SPECIAL_BOMB:Int=7
Const SPECIAL_TWISTER:Int=8
+ Const SPECIAL_NUKE:Int=9
+ Const SPECIAL_CROSS:Int=10
Const DIR_NONE:Int=0
Const DIR_UP:Int=1
@@ -52,13 +54,32 @@ Type TWire
Field t:Int
Function Init()
- rotright=[0,2,1,4,6,3,5,7,8]
- rotleft=[0,2,1,5,3,6,4,7,8]
-
- img=[GameGFX.cross,GameGFX.left_right,GameGFX.top_bottom,GameGFX.top_left,GameGFX.top_right,GameGFX.bottom_left,GameGFX.bottom_right,GameGFX.special_bomb,GameGFX.special_twister]
-
- ' CROSS LEFT_RIGHT TOP_BOTTOM TOP_LEFT TOP_RIGHT BOTTOM_LEFT BOTTOM_RIGHT SPECIAL_BOMB SPECIAL_TWISTER
- dir=[[DIR_UP,DIR_RIGHT,DIR_DOWN,DIR_LEFT], [DIR_NONE,DIR_RIGHT,DIR_NONE,DIR_LEFT], [DIR_UP,DIR_NONE,DIR_DOWN,DIR_NONE], [DIR_NONE,DIR_UP,DIR_LEFT,DIR_NONE], [DIR_NONE,DIR_NONE,DIR_RIGHT,DIR_UP], [DIR_LEFT,DIR_DOWN,DIR_NONE,DIR_NONE], [DIR_RIGHT,DIR_NONE,DIR_NONE,DIR_DOWN], [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE], [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE]]
+ rotright=[0,2,1,4,6,3,5,7,8,9,10]
+ rotleft=[0,2,1,5,3,6,4,7,8,9,10]
+
+ img=[GameGFX.cross, ..
+ GameGFX.left_right, ..
+ GameGFX.top_bottom, ..
+ GameGFX.top_left, ..
+ GameGFX.top_right, ..
+ GameGFX.bottom_left, ..
+ GameGFX.bottom_right, ..
+ GameGFX.special_bomb, ..
+ GameGFX.special_twister, ..
+ GameGFX.special_nuke, ..
+ GameGFX.special_cross]
+
+ dir=[[DIR_UP,DIR_RIGHT,DIR_DOWN,DIR_LEFT], .. ' CROSS
+ [DIR_NONE,DIR_RIGHT,DIR_NONE,DIR_LEFT], .. ' LEFT_RIGHT
+ [DIR_UP,DIR_NONE,DIR_DOWN,DIR_NONE], .. ' TOP_BOTTOM
+ [DIR_NONE,DIR_UP,DIR_LEFT,DIR_NONE], .. ' TOP_LEFT
+ [DIR_NONE,DIR_NONE,DIR_RIGHT,DIR_UP], .. ' TOP_RIGHT
+ [DIR_LEFT,DIR_DOWN,DIR_NONE,DIR_NONE], .. ' BOTTOM_LEFT
+ [DIR_RIGHT,DIR_NONE,DIR_NONE,DIR_DOWN], .. ' BOTTOM_RIGHT
+ [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE], .. ' SPECIAL_BOMB
+ [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE], .. ' SPECIAL_TWISTER
+ [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE], .. ' SPECIAL_NUKE
+ [DIR_NONE,DIR_NONE,DIR_NONE,DIR_NONE]] ' SPECIAL_CROSS
dx=[0,0,1,0,-1]
dy=[0,-1,0,1,0]
@@ -121,16 +142,23 @@ Type TPiece Abstract
Field coli:Int
Field frame:Int
Field framed:Int
+ Field framespd:Int
+ Field framei:Int
+ Field pong:Int
Function Create:TPiece(special:Int)
Local o:TPiece
If special
- Select Rand(0,1)
+ Select Rand(0,3)
Case 0
o=TPiece(New TPiece_SpecialBomb)
Case 1
o=TPiece(New TPiece_SpecialTwister)
+ Case 2
+ o=TPiece(New TPiece_SpecialNuke)
+ Case 3
+ o=TPiece(New TPiece_SpecialCross)
End Select
Else
Select Rand(0,5)
@@ -154,10 +182,50 @@ Type TPiece Abstract
Return o
End Function
+ Function CreateSpecific:TPiece(t:Int)
+ Local o:TPiece
+ Local s:Int=False
+
+ Select t
+ Case 0
+ o=TPiece(New TPiece_S_Left)
+ Case 1
+ o=TPiece(New TPiece_S_Right)
+ Case 2
+ o=TPiece(New TPiece_L_Left)
+ Case 3
+ o=TPiece(New TPiece_L_Right)
+ Case 4
+ o=TPiece(New TPiece_Square)
+ Case 5
+ o=TPiece(New TPiece_Bar)
+ Case 6
+ o=TPiece(New TPiece_SpecialBomb)
+ s=True
+ Case 7
+ o=TPiece(New TPiece_SpecialTwister)
+ s=True
+ Case 8
+ o=TPiece(New TPiece_SpecialNuke)
+ s=True
+ Case 9
+ o=TPiece(New TPiece_SpecialCross)
+ s=True
+ Default
+ Return Create(False)
+ End Select
+
+ o.BaseInit(s)
+
+ Return o
+ End Function
+
Method Init() Abstract
Method BaseInit(special:Int)
special_pulse=False
+ framespd=5
+ pong=False
Init()
rot=0
ox=offx[rot]
@@ -167,6 +235,7 @@ Type TPiece Abstract
coli=-1
frame=0
framed=0
+ framei=1
End Method
Method Draw()
@@ -177,9 +246,16 @@ Type TPiece Abstract
EndIf
framed:+1
- If framed=5
+ If framed=framespd
framed=0
- frame=(frame+1) Mod 4
+ If pong
+ frame:+framei
+ If frame=0 Or frame=3
+ framei=-framei
+ EndIf
+ Else
+ frame=(frame+1) Mod 4
+ EndIf
EndIf
For Local px:Int=0 Until 4
@@ -481,6 +557,101 @@ Type TPiece_SpecialTwister Extends TSpecial
End Method
End Type
+Type TPiece_SpecialNuke Extends TSpecial
+ Method Init()
+ special_pulse=True
+ map[0,0]=TWire.Create([TWire.SPECIAL_NUKE])
+ offx=[0,0,0,0]
+ offy=[0,0,0,0]
+ End Method
+
+ Method AddToList(gm:TGameMap, l:TWireList, t:Int)
+ For Local px:Int=0 Until Pit.WIDTH
+ For Local py:Int=0 Until Pit.HEIGHT
+ If gm.map[px,py] And gm.map[px,py].t=t
+ l.Add(px,py,gm.map[px,py])
+ EndIf
+ Next
+ Next
+ End Method
+
+ Method DoSpecial:Int(gm:TGameMap)
+ Draw()
+
+ Local l:TWireList=New TWireList
+
+ If y<Pit.HEIGHT-1 And gm.map[x,y+1]
+ AddToList(gm,l,gm.map[x,y+1].t)
+ EndIf
+
+ If x>0 And gm.map[x-1,y]
+ AddToList(gm,l,gm.map[x-1,y].t)
+ EndIf
+
+ If x<Pit.WIDTH-1 And gm.map[x+1,y]
+ AddToList(gm,l,gm.map[x+1,y].t)
+ EndIf
+
+ If l.Count()=0
+ TextParticles.Big("WHAT A WASTE!",255,0,0)
+ Else
+ TextParticles.Big("SMART NUKE!",255,255,0)
+ gm.path.AddLast(l)
+ EndIf
+
+ ExplosionParticles.BlowUp(Pit.X(x),Pit.Y(y))
+
+ Return False
+ End Method
+End Type
+
+Type TPiece_SpecialCross Extends TSpecial
+
+ Method Init()
+ special_pulse=True
+ pong=True
+ map[0,0]=TWire.Create([TWire.SPECIAL_CROSS])
+ offx=[0,0,0,0]
+ offy=[0,0,0,0]
+ End Method
+
+ Method DoSpecial:Int(gm:TGameMap)
+ Draw()
+
+ TextParticles.Big("SUPER CROSS!",255,255,0)
+
+ For Local px:Int=x+1 Until Pit.WIDTH
+ If gm.map[px,y]
+ gm.map[px,y].t=TWire.CROSS
+ Particles.AddDust(Pit.X(px)+16,Pit.Y(y)+32)
+ EndIf
+ Next
+
+ For Local px:Int=0 Until x
+ If gm.map[px,y]
+ gm.map[px,y].t=TWire.CROSS
+ Particles.AddDust(Pit.X(px)+16,Pit.Y(y)+32)
+ EndIf
+ Next
+
+ For Local py:Int=y+1 Until Pit.HEIGHT
+ If gm.map[x,py]
+ gm.map[x,py].t=TWire.CROSS
+ Particles.AddDust(Pit.X(x)+16,Pit.Y(py)+32)
+ EndIf
+ Next
+
+ If Not gm.CheckWires()
+ gm.Flatten()
+ gm.CheckWires()
+ EndIf
+
+ ExplosionParticles.BlowUp(Pit.X(x),Pit.Y(y))
+
+ Return False
+ End Method
+End Type
+
Type TWireListEnt
Field w:TWire
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
+?
+
diff --git a/help.bmx b/help.bmx
index df2e80b..3350157 100644
--- a/help.bmx
+++ b/help.bmx
@@ -22,6 +22,8 @@ Incbin "HELP/wire3.png"
Incbin "HELP/loop1.png"
Incbin "HELP/bomb.png"
Incbin "HELP/twister.png"
+Incbin "HELP/nuke.png"
+Incbin "HELP/cross.png"
Type THelp
Const TOP:Int=50
@@ -41,10 +43,19 @@ Type THelp
While Not str.Eof()
Local line:String=str.ReadLine()
- If line.length And line[0]=Asc("#")
- list.AddLast(THelpImage.Create(line[1..]))
+ If line.length
+ Select line[0]
+ Case Asc("#")
+ list.AddLast(THelpImage.Create(line[1..]))
+ Case Asc("$")
+ list.AddLast(THelpAnimImage.Create(line[1..],False))
+ Case Asc("~~")
+ list.AddLast(THelpAnimImage.Create(line[1..],True))
+ Default
+ list.AddLast(THelpText.Create(line))
+ End Select
Else
- list.AddLast(THelpText.Create(line))
+ list.AddLast(THelpBlankLine.Create(line))
EndIf
Wend
@@ -95,6 +106,7 @@ Type THelp
Method Show()
Local done:Int=False
+ Local fade:TFadeScreen=TFadeScreen.FadeIn()
While Not done
Cls
@@ -128,6 +140,14 @@ Type THelp
del=0
EndIf
+ If fade
+ If fade.Fade()
+ fade.Draw()
+ Else
+ fade=Null
+ EndIf
+ EndIf
+
Flip
Wend
@@ -186,6 +206,21 @@ Type THelpText Extends THelpItem
End Type
+Type THelpBlankLine Extends THelpItem
+ Function Create:THelpItem(txt:String)
+ Local o:THelpBlankLine=New THelpBlankLine
+ Return THelpItem(o)
+ End Function
+
+ Method Height:Int()
+ Return GameGFX.large.MaxHeight()
+ End Method
+
+ Method Draw(y:Int)
+ End Method
+End Type
+
+
Type THelpImage Extends THelpItem
Field img:TImage
Field x:Int
@@ -193,7 +228,7 @@ Type THelpImage Extends THelpItem
Function Create:THelpItem(url:String)
Local o:THelpImage=New THelpImage
o.img=LoadImage(url)
- Assert o,"Failed to load help image " + url
+ Assert o.img,"Failed to load help image " + url
o.x=(GraphicsWidth()-ImageWidth(o.img))/2
Return THelpItem(o)
End Function
@@ -206,4 +241,47 @@ Type THelpImage Extends THelpItem
SetColor(255,255,255)
DrawImage(img,x,y)
End Method
+End Type
+
+
+Type THelpAnimImage Extends THelpItem
+ Field img:TImage
+ Field x:Int
+ Field frame:Int
+ Field framei:Int
+ Field framed:Int
+ Field pong:Int
+
+ Function Create:THelpItem(url:String,pong:Int)
+ Local o:THelpAnimImage=New THelpAnimImage
+ o.img=LoadAnimImage(url,32,32,0,4)
+ Assert o.img,"Failed to load help anim image " + url
+ o.x=(GraphicsWidth()-32)/2
+ o.frame=0
+ o.framed=5
+ o.framei=1
+ o.pong=pong
+ Return THelpItem(o)
+ End Function
+
+ Method Height:Int()
+ Return ImageHeight(img)
+ End Method
+
+ Method Draw(y:Int)
+ SetColor(255,255,255)
+ DrawImage(img,x,y,frame)
+ framed:-1
+ If framed=0
+ framed=5
+ If pong
+ frame:+framei
+ If frame=0 Or frame=3
+ framei=-framei
+ EndIf
+ Else
+ frame=(frame+1) Mod 4
+ EndIf
+ EndIf
+ End Method
End Type \ No newline at end of file
diff --git a/types.bmx b/types.bmx
index c4211ef..bc4349c 100644
--- a/types.bmx
+++ b/types.bmx
@@ -50,6 +50,8 @@ Incbin "TILES/bottom_right.png"
Incbin "TILES/special_bomb.png"
Incbin "TILES/special_twister.png"
+Incbin "TILES/special_nuke.png"
+Incbin "TILES/special_cross.png"
Const HERTZ:Int=60
@@ -111,6 +113,8 @@ Type GameGFX
Global special_bomb:TImage
Global special_twister:TImage
+ Global special_nuke:TImage
+ Global special_cross:TImage
Global bdropstar:TImage
@@ -176,6 +180,8 @@ Type GameGFX
special_bomb=SafeLoadAnimImage("incbin::TILES/special_bomb.png",32,32,0,4,DYNAMICIMAGE)
special_twister=SafeLoadAnimImage("incbin::TILES/special_twister.png",32,32,0,4,DYNAMICIMAGE)
+ special_nuke=SafeLoadAnimImage("incbin::TILES/special_nuke.png",32,32,0,4,DYNAMICIMAGE)
+ special_cross=SafeLoadAnimImage("incbin::TILES/special_cross.png",32,32,0,4,DYNAMICIMAGE)
bdropstar=SafeLoadAnimImage("incbin::GFX/bdropstar.png",8,8,0,6,0)'FILTEREDIMAGE)
End Function
@@ -273,68 +279,6 @@ Type TEasyLink
End Type
-Type TMenuBdrop_Orig Extends TGfxMenuBackdrop
- Const NUM:Int=3
- Const SIZE:Double=50.0
- Const OFFSET:Double=500.0
- Field a:Int[NUM]
- Field msg:String
- Field msgp:Int
- Field msgx:Int
- Field msgy:Int
-
- Method New()
- For Local f:Int=0 Until NUM
- a[f]=360/NUM*f
- Next
-
- msg=" "
- msg:+"Welcome to Hardwire. "
- 'msg:+"Welcome to Hardwire. The object of the game is to connect the electrodes around the side of the pit using "
- 'msg:+"the wires embedded in the blocks. "
- 'msg:+"If you let the pit overflow the game is over. That's all there is to it... Press the RULES button for help on how to play. "
- msg:+"Hardwire was written using BlitzMax -- http://www.blitzbasic.com/ -- and a variety of tools available at "
- msg:+"http://www.noddybox.demon.co.uk/ Please feel free to forward this game to whoever you hate enough "
- msg:+"to inflict this monstrosity upon. Enjoy. This game written under the influence of Slay Radio -- http://www.slayradio.org"
-
- msgx=0
- msgp=0
- msgy=OFFSET
- End Method
-
- Method Create:TGfxMenuBackdrop()
- Return Self
- End Method
-
- Method Update()
- For Local f:Int=0 Until NUM
- a[f]=(a[f]+2) Mod 360
-
- If a[f]<=180
- Local c:Int=128-Abs(64*Lookup.si[a[f]])
- SetColor(c,c,c)
- DrawImage(GameGFX.copper,0,OFFSET+SIZE*Lookup.co[a[f]])
- EndIf
- Next
-
- GameGFX.large.Draw(msg[..80],msgx,msgy)
- msgx:-2
- If msgx<-GameGFX.large.TextWidth(msg[0..1])
- msgx:+GameGFX.large.TextWidth(msg[0..1])
- msg=msg[1..]+msg[0..1]
- EndIf
-
- For Local f:Int=0 Until NUM
- If a[f]>180
- Local c:Int=128+Abs(64*Lookup.si[a[f]])
- SetColor(c,c,c)
- DrawImage(GameGFX.copper,0,OFFSET+SIZE*Lookup.co[a[f]])
- EndIf
- Next
- SetColor(255,255,255)
- End Method
-End Type
-
Type TMenuBdrop Extends TGfxMenuBackdrop
Field msg:String
Field msgp:Int
@@ -345,9 +289,6 @@ Type TMenuBdrop Extends TGfxMenuBackdrop
msg=" "
msg=" "
msg:+"Welcome to Hardwire. "
- 'msg:+"Welcome to Hardwire. The object of the game is to connect the electrodes around the side of the pit using "
- 'msg:+"the wires embedded in the blocks. "
- 'msg:+"If you let the pit overflow the game is over. That's all there is to it... Press the RULES button for help on how to play. "
msg:+"Hardwire was written using BlitzMax -- http://www.blitzbasic.com/ -- and a variety of tools available at "
msg:+"http://www.noddybox.demon.co.uk/ Please feel free to forward this game to whoever you hate enough "
msg:+"to inflict this monstrosity upon. Enjoy. This game written under the influence of Slay Radio -- http://www.slayradio.org"
@@ -391,6 +332,18 @@ Type TFadeScreen
Return Create(1,-0.05)
End Function
+ Function DoFadeOut()
+ Local 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
+
Method Fade:Int()
a:+ai
Return a>0 And a<1