summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TILES/special_bomb.pngbin657 -> 658 bytes
-rw-r--r--TILES/special_twister.pngbin712 -> 617 bytes
-rw-r--r--TILES/tiles.bmsbin98831 -> 98831 bytes
-rw-r--r--game.bmx5
-rw-r--r--gametypes.bmx57
-rw-r--r--particle.bmx5
-rw-r--r--types.bmx76
7 files changed, 102 insertions, 41 deletions
diff --git a/TILES/special_bomb.png b/TILES/special_bomb.png
index e182696..f00d799 100644
--- a/TILES/special_bomb.png
+++ b/TILES/special_bomb.png
Binary files differ
diff --git a/TILES/special_twister.png b/TILES/special_twister.png
index 1446d1b..eaa0ee1 100644
--- a/TILES/special_twister.png
+++ b/TILES/special_twister.png
Binary files differ
diff --git a/TILES/tiles.bms b/TILES/tiles.bms
index 779a0c3..4244143 100644
--- a/TILES/tiles.bms
+++ b/TILES/tiles.bms
Binary files differ
diff --git a/game.bmx b/game.bmx
index 94edada..16fb3e7 100644
--- a/game.bmx
+++ b/game.bmx
@@ -115,8 +115,6 @@ Type TGame
Cls
- TextParticles.Draw()
-
GameGFX.large.Draw("SCORE",0,0,255,255,0)
GameGFX.large.Draw(score,0,20)
@@ -150,7 +148,7 @@ Type TGame
If Not gm.overflow
score:+level*2
- CreateNext((total Mod 30)=0)
+ CreateNext((total Mod 2)=0) ' 15
Else
FlushKeys()
EndIf
@@ -219,6 +217,7 @@ Type TGame
EndIf
Particles.Draw()
+ TextParticles.Draw()
If KeyHit(GameConfig.kpause) And Not gm.overflow
Pause()
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
diff --git a/particle.bmx b/particle.bmx
index 6eba5d3..fbf2b6f 100644
--- a/particle.bmx
+++ b/particle.bmx
@@ -164,7 +164,10 @@ Type TextParticles
sy=300
End Function
- Function Big(txt:String, r:Int, g:Int, b:Int)
+ Function Big(txt:String, r:Int=-1, g:Int=-1, b:Int=-1)
+ If r=-1 Then r=Rand(128,255)
+ If g=-1 Then g=Rand(128,255)
+ If b=-1 Then b=Rand(128,255)
plist.AddLast(TTextParticle.Create(GameGFX.font,txt,-1,GraphicsHeight()-GameGFX.font.MaxHeight()/2,0,0,r,g,b,1,-0.01,1,0))
plist.AddLast(TTextParticle.Create(GameGFX.font,txt,-1,GraphicsHeight()-GameGFX.font.MaxHeight()/2,0,0,r,g,b,1,-0.02,1,0.1))
End Function
diff --git a/types.bmx b/types.bmx
index 0de29d6..c5ca14f 100644
--- a/types.bmx
+++ b/types.bmx
@@ -108,52 +108,68 @@ Type GameGFX
Global special_bomb:TImage
Global special_twister:TImage
+ Function SafeLoadImage:TImage(p:String, mode:Int)
+ Local i:TImage=LoadImage(p,mode)
+ Assert i,"Failed to load " + p
+ Return i
+ End Function
+
+ Function SafeLoadAnimImage:TImage(p:String, w:Int, h:Int, f:Int, c:Int, mode:Int)
+ Local i:TImage=LoadAnimImage(p,w,h,f,c,mode)
+ Assert i,"Failed to load " + p
+ Return i
+ End Function
+
Function Init()
font=TBitmapFont.Load("incbin::GFX/font.bmf",0)
small=TBitmapFont.Load("incbin::GFX/small.bmf",0)
large=TBitmapFont.Load("incbin::GFX/large.bmf",0)
+
+ Assert font,"Failed to load incbin::GFX/font.bmf"
+ Assert small,"Failed to load incbin::GFX/small.bmf"
+ Assert large,"Failed to load incbin::GFX/large.bmf"
- title=LoadImage("incbin::GFX/title.png",0)
- gameover=LoadImage("incbin::GFX/gameover.png",0)
+ title=SafeLoadImage("incbin::GFX/title.png",0)
+ gameover=SafeLoadImage("incbin::GFX/gameover.png",0)
MidHandleImage(gameover)
- pointer=LoadImage("incbin::GFX/pointer.png",0)
+ pointer=SafeLoadImage("incbin::GFX/pointer.png",0)
- copper=LoadImage("incbin::GFX/copper.png",0)
- copperslice=LoadImage("incbin::GFX/copperslice.png",0)
+ copper=SafeLoadImage("incbin::GFX/copper.png",0)
+ copperslice=SafeLoadImage("incbin::GFX/copperslice.png",0)
- dust=LoadImage("incbin::GFX/dust.png",FILTEREDIMAGE)
+ dust=SafeLoadImage("incbin::GFX/dust.png",FILTEREDIMAGE)
MidHandleImage(dust)
- play_button=LoadImage("incbin::GFX/play_button.png",0)
- quit_button=LoadImage("incbin::GFX/quit_button.png",0)
- scores_button=LoadImage("incbin::GFX/scores_button.png",0)
- keys_button=LoadImage("incbin::GFX/keys_button.png",0)
- left_button=LoadImage("incbin::GFX/left_button.png",0)
- right_button=LoadImage("incbin::GFX/right_button.png",0)
+ play_button=SafeLoadImage("incbin::GFX/play_button.png",0)
+ quit_button=SafeLoadImage("incbin::GFX/quit_button.png",0)
+ scores_button=SafeLoadImage("incbin::GFX/scores_button.png",0)
+ keys_button=SafeLoadImage("incbin::GFX/keys_button.png",0)
+ left_button=SafeLoadImage("incbin::GFX/left_button.png",0)
+ right_button=SafeLoadImage("incbin::GFX/right_button.png",0)
- tile=LoadImage("incbin::TILES/tile.png",0)
+ tile=SafeLoadImage("incbin::TILES/tile.png",0)
- pit_top=LoadImage("incbin::TILES/pit_top.png",0)
- pit_bottom=LoadImage("incbin::TILES/pit_bottom.png",0)
- pit_bottomleft=LoadImage("incbin::TILES/pit_bottomleft.png",0)
- pit_bottomright=LoadImage("incbin::TILES/pit_bottomright.png",0)
- pit_side=LoadImage("incbin::TILES/pit_side.png",0)
+ pit_top=SafeLoadImage("incbin::TILES/pit_top.png",0)
+ pit_bottom=SafeLoadImage("incbin::TILES/pit_bottom.png",0)
+ pit_bottomleft=SafeLoadImage("incbin::TILES/pit_bottomleft.png",0)
+ pit_bottomright=SafeLoadImage("incbin::TILES/pit_bottomright.png",0)
+ pit_side=SafeLoadImage("incbin::TILES/pit_side.png",0)
- trode_left=LoadImage("incbin::TILES/trode_left.png",0)
- trode_right=LoadImage("incbin::TILES/trode_right.png",0)
- trode_bottom=LoadImage("incbin::TILES/trode_bottom.png",0)
+ trode_left=SafeLoadImage("incbin::TILES/trode_left.png",0)
+ trode_right=SafeLoadImage("incbin::TILES/trode_right.png",0)
+ trode_bottom=SafeLoadImage("incbin::TILES/trode_bottom.png",0)
- top_bottom=LoadImage("incbin::TILES/top_bottom.png",0)
- left_right=LoadImage("incbin::TILES/left_right.png",0)
- cross=LoadImage("incbin::TILES/cross.png",0)
- top_left=LoadImage("incbin::TILES/top_left.png",0)
- top_right=LoadImage("incbin::TILES/top_right.png",0)
- bottom_left=LoadImage("incbin::TILES/bottom_left.png",0)
- bottom_right=LoadImage("incbin::TILES/bottom_right.png",0)
+ top_bottom=SafeLoadImage("incbin::TILES/top_bottom.png",0)
+ left_right=SafeLoadImage("incbin::TILES/left_right.png",0)
+ cross=SafeLoadImage("incbin::TILES/cross.png",0)
+ top_left=SafeLoadImage("incbin::TILES/top_left.png",0)
+ top_right=SafeLoadImage("incbin::TILES/top_right.png",0)
+ bottom_left=SafeLoadImage("incbin::TILES/bottom_left.png",0)
+ bottom_right=SafeLoadImage("incbin::TILES/bottom_right.png",0)
- special_bomb=LoadAnimImage("incbin::TILES/special_bomb.png",32,32,0,40)
- special_twister=LoadAnimImage("incbin::TILES/special_twister.png",32,32,0,40)
+ special_bomb=SafeLoadAnimImage("incbin::TILES/special_bomb.png",32,32,0,4,0)
+ special_twister=SafeLoadAnimImage("incbin::TILES/special_twister.png",32,32,0,4,0)
End Function
End Type