summaryrefslogtreecommitdiff
path: root/types.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'types.bmx')
-rw-r--r--types.bmx172
1 files changed, 160 insertions, 12 deletions
diff --git a/types.bmx b/types.bmx
index c5ca14f..c4211ef 100644
--- a/types.bmx
+++ b/types.bmx
@@ -4,6 +4,9 @@
'
' $Id$
'
+'
+' This should really be called Global.bmx probably...
+'
Strict
Import noddybox.bitmapfont
Import noddybox.gfxmenu
@@ -17,8 +20,8 @@ Incbin "GFX/large.bmf"
Incbin "GFX/pointer.png"
Incbin "GFX/play_button.png"
Incbin "GFX/quit_button.png"
-Incbin "GFX/scores_button.png"
Incbin "GFX/keys_button.png"
+Incbin "GFX/rules_button.png"
Incbin "GFX/left_button.png"
Incbin "GFX/right_button.png"
Incbin "GFX/copper.png"
@@ -26,6 +29,7 @@ Incbin "GFX/copperslice.png"
Incbin "GFX/dust.png"
Incbin "GFX/title.png"
Incbin "GFX/gameover.png"
+Incbin "GFX/bdropstar.png"
Incbin "TILES/tile.png"
Incbin "TILES/pit_top.png"
@@ -82,7 +86,7 @@ Type GameGFX
Global quit_button:TImage
Global left_button:TImage
Global right_button:TImage
- Global scores_button:TImage
+ Global rules_button:TImage
Global keys_button:TImage
Global tile:TImage
@@ -108,6 +112,8 @@ Type GameGFX
Global special_bomb:TImage
Global special_twister:TImage
+ Global bdropstar:TImage
+
Function SafeLoadImage:TImage(p:String, mode:Int)
Local i:TImage=LoadImage(p,mode)
Assert i,"Failed to load " + p
@@ -143,7 +149,7 @@ Type GameGFX
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)
+ rules_button=SafeLoadImage("incbin::GFX/rules_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)
@@ -168,8 +174,10 @@ Type GameGFX
bottom_left=SafeLoadImage("incbin::TILES/bottom_left.png",0)
bottom_right=SafeLoadImage("incbin::TILES/bottom_right.png",0)
- 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)
+ 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)
+
+ bdropstar=SafeLoadAnimImage("incbin::GFX/bdropstar.png",8,8,0,6,0)'FILTEREDIMAGE)
End Function
End Type
@@ -181,6 +189,7 @@ Type GameConfig
Global kdrop:Int
Global kpause:Int
Global start_level:Int
+ Global hiscore:Int
Function Load()
Local s:TStream=ReadStream("hardwire.config")
@@ -193,6 +202,7 @@ Type GameConfig
kdrop=KEY_SPACE
kpause=KEY_P
start_level=1
+ hiscore=0
Return
EndIf
@@ -205,6 +215,7 @@ Type GameConfig
kdrop=s.ReadInt()
kpause=s.ReadInt()
start_level=s.ReadInt()
+ hiscore=s.ReadInt()
s.Close()
End Function
@@ -225,6 +236,7 @@ Type GameConfig
s.WriteInt(kdrop)
s.WriteInt(kpause)
s.WriteInt(start_level)
+ s.WriteInt(hiscore)
s.Close()
End Function
@@ -261,8 +273,8 @@ Type TEasyLink
End Type
-Type TMenuBdrop Extends TGfxMenuBackdrop
- Const NUM:Int=2
+Type TMenuBdrop_Orig Extends TGfxMenuBackdrop
+ Const NUM:Int=3
Const SIZE:Double=50.0
Const OFFSET:Double=500.0
Field a:Int[NUM]
@@ -277,12 +289,13 @@ Type TMenuBdrop Extends TGfxMenuBackdrop
Next
msg=" "
- 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. Once a circuit is completed those blocks are removed. Once in a while new blocks will fall from the sky. "
- msg:+"If you let the pit overflow the game is over. That's all there is to it... "
+ 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 on to whoever you despise enough "
- msg:+"to inflict this monstrosity upon. Enjoy."
+ 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
@@ -321,3 +334,138 @@ Type TMenuBdrop Extends TGfxMenuBackdrop
SetColor(255,255,255)
End Method
End Type
+
+Type TMenuBdrop Extends TGfxMenuBackdrop
+ Field msg:String
+ Field msgp:Int
+ Field msgx:Int
+ Field msgy:Int
+
+ Method New()
+ 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"
+
+ msgx=0
+ msgp=0
+ msgy=560
+ End Method
+
+ Method Create:TGfxMenuBackdrop()
+ Return Self
+ End Method
+
+ Method Update()
+ 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
+ End Method
+End Type
+
+Type TFadeScreen
+ Field a:Double
+ Field ai:Double
+
+ Function Create:TFadeScreen(a:Double, ai:Double)
+ Local o:TFadeScreen=New TFadeScreen
+ o.a=a
+ o.ai=ai
+ Return o
+ End Function
+
+ Function FadeOut:TFadeScreen()
+ Return Create(0,0.05)
+ End Function
+
+ Function FadeIn:TFadeScreen()
+ Return Create(1,-0.05)
+ End Function
+
+ Method Fade:Int()
+ a:+ai
+ Return a>0 And a<1
+ End Method
+
+ Method Draw()
+ Local r:Int,g:Int,b:Int
+ Local oa:Double=GetAlpha()
+ GetColor(r,g,b)
+ SetAlpha(a)
+ SetColor(0,0,0)
+ DrawRect(0,0,GraphicsWidth(),GraphicsHeight())
+ SetColor(r,g,b)
+ SetAlpha(oa)
+ End Method
+End Type
+
+Type TGameBackdropStar
+ Field x:Double
+ Field y:Double
+ Field dy:Double
+ Field r:Int
+ Field g:Int
+ Field b:Int
+ Field frame:Int
+ Field cnt:Int
+
+ Method New()
+ x=Rnd(0,GraphicsWidth())
+ y=Rnd(0,GraphicsHeight())
+ dy=Rnd(0.1,2)
+ r=Rand(128,255)
+ g=Rand(128,255)
+ b=Rand(128,255)
+ frame=Rand(0,5)
+ cnt=5
+ End Method
+
+ Method Draw(anim:Int)
+ If anim
+ frame=(frame+1) Mod 6
+ EndIf
+
+ y:+dy
+ If y>GraphicsHeight()+8
+ y=-8
+ EndIf
+ SetColor(r,g,b)
+ DrawImage(GameGFX.bdropstar,x,y,frame)
+ End Method
+End Type
+
+
+Type TGameBackdrop
+ Field num:Int
+ Field star:TGameBackdropStar[]
+ Field cnt:Int
+
+ Method New()
+ num=100
+ star=New TGameBackdropStar[num]
+ cnt=5
+
+ For Local f:Int=0 Until num
+ star[f]=New TGameBackdropStar
+ Next
+ End Method
+
+ Method Draw()
+ For Local f:Int=0 Until num
+ star[f].Draw(cnt=0)
+ Next
+ cnt:-1
+ If cnt=-1
+ cnt=5
+ EndIf
+ End Method
+End Type \ No newline at end of file