summaryrefslogtreecommitdiff
path: root/gametypes.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'gametypes.bmx')
-rw-r--r--gametypes.bmx57
1 files changed, 50 insertions, 7 deletions
diff --git a/gametypes.bmx b/gametypes.bmx
index 004e69e..63a642b 100644
--- a/gametypes.bmx
+++ b/gametypes.bmx
@@ -56,7 +56,7 @@ Type TWire
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]]
@@ -126,7 +126,7 @@ Type TPiece Abstract
Local o:TPiece
If special
- Select Rand(0,5)
+ Select Rand(0,1)
Case 0
o=TPiece(New TPiece_SpecialBomb)
Case 1
@@ -402,11 +402,11 @@ Type TPiece_SpecialBomb Extends TSpecial
Local l:TWireList=New TWireList
If y<Pit.HEIGHT-1
- Local t:Int=map[x,y+1].t
+ Local t:Int=gm.map[x,y+1].t
For Local px:Int=0 Until Pit.WIDTH
For Local py:Int=0 Until Pit.HEIGHT
- If gm.map[px,py] And map[px,py].t=t
+ If gm.map[px,py] And gm.map[px,py].t=t
l.Add(px,py,gm.map[px,py])
EndIf
Next
@@ -416,17 +416,21 @@ Type TPiece_SpecialBomb Extends TSpecial
If l.Count()=0
TextParticles.Big("WHAT A WASTE!",255,0,0)
Else
- TextParticles.Big("SPECIAL GOT " + (l.Count()-1) + " BLOCKS!",255,255,0)
+ TextParticles.Big("SMART BOMB!",255,255,0)
+ gm.path.AddLast(l)
EndIf
- gm.path.AddLast(l)
-
Return False
End Method
End Type
Type TPiece_SpecialTwister Extends TSpecial
+ Field rot:Int
+ Field rotd:Int
+
Method Init()
+ rot=0
+ rotd=0
special_pulse=True
map[0,0]=TWire.Create([TWire.SPECIAL_TWISTER])
offx=[0,0,0,0]
@@ -434,6 +438,39 @@ Type TPiece_SpecialTwister Extends TSpecial
End Method
Method DoSpecial:Int(gm:TGameMap)
+ If gm.path.Count()
+ Return True
+ EndIf
+
+ If rotd=0
+ rotd=60
+ rot:+1
+ If rot=5
+ Return False
+ EndIf
+ TextParticles.Big("TWIST!")
+ Else
+ rotd:-1
+ Return True
+ EndIf
+
+ For Local px:Int=0 Until Pit.WIDTH
+ For Local py:Int=0 Until Pit.HEIGHT
+ If gm.map[px,py]
+ gm.map[px,py].RotateRight()
+ Particles.AddDust(Pit.X(px)+16,Pit.Y(py)+32)
+ EndIf
+ Next
+ Next
+
+ Sound.Click()
+
+ If Not gm.CheckWires()
+ gm.Flatten()
+ gm.CheckWires()
+ EndIf
+
+ Return True
End Method
End Type
@@ -697,6 +734,12 @@ Type TGameMap
Next
Next
+ If special
+ If Not special.DoSpecial(Self)
+ special=Null
+ EndIf
+ EndIf
+
Local l:TEasyLink=TEasyLink.Create(path)
Local check:Int=False