summaryrefslogtreecommitdiff
path: root/help.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 /help.bmx
parentcf0e1b5f3422dc1adc60b1684591ab0962c441bb (diff)
Development checkin
Diffstat (limited to 'help.bmx')
-rw-r--r--help.bmx86
1 files changed, 82 insertions, 4 deletions
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