summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-06-14 00:21:33 +0000
committerIan C <ianc@noddybox.co.uk>2005-06-14 00:21:33 +0000
commitf6b1934a27375bb633e70757d672eae1e3485f5a (patch)
tree61a92cc75fdaf0e03c6ffad8231b0e6ed94dcff7
parenta92e882fa5d7b71deaa7ff6be7dd66cb1a348d6e (diff)
*** empty log message ***
-rw-r--r--.cvsignore2
-rw-r--r--GFX/backdrop.bmpbin0 -> 1440054 bytes
-rw-r--r--GFX/backdrop.c4dbin0 -> 106459 bytes
-rw-r--r--font_fade.bmx108
-rw-r--r--main.bmx167
5 files changed, 277 insertions, 0 deletions
diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..953a728
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,2 @@
+main.debug.exe
+.bmx \ No newline at end of file
diff --git a/GFX/backdrop.bmp b/GFX/backdrop.bmp
new file mode 100644
index 0000000..7e4a969
--- /dev/null
+++ b/GFX/backdrop.bmp
Binary files differ
diff --git a/GFX/backdrop.c4d b/GFX/backdrop.c4d
new file mode 100644
index 0000000..4183fe7
--- /dev/null
+++ b/GFX/backdrop.c4d
Binary files differ
diff --git a/font_fade.bmx b/font_fade.bmx
new file mode 100644
index 0000000..62f5e82
--- /dev/null
+++ b/font_fade.bmx
@@ -0,0 +1,108 @@
+'
+' Provides text fade routines
+'
+' $Id$
+'
+Type FontFade
+ Field list:TList
+ Field font:BitmapFont
+
+ Function Create:FontFade(f:BitmapFont)
+ Local ff:FontFade=New FontFade
+
+ ff.list=New TList
+ ff.font=f
+
+ Return ff
+ End Function
+
+ Method Add(s:String, x:Float, y:Float, col:Int, a:Float, ai:Float, dx:Float, dy:Float)
+ Local f:FontFadeEnt=New FontFadeEnt
+
+ f.s=s
+ f.x=x
+ f.y=y
+ f.dx=dx
+ f.dy=dy
+ f.r=(col & $ff0000) Shr 16
+ f.g=(col & $ff00) Shr 8
+ f.r=(col & $ff)
+ f.a=a
+ f.ai=ai
+ f.centre=False
+
+ list.AddLast(f)
+ End Method
+
+ Method Centre(s:String, y:Float, col:Int, a:Float, ai:Float, dy:Float)
+ Local f:FontFadeEnt=New FontFadeEnt
+
+ f.s=s
+ f.x=0
+ f.y=y
+ f.dx=0
+ f.dy=dy
+ f.r=(col & $ff0000) Shr 16
+ f.g=(col & $ff00) Shr 8
+ f.b=(col & $ff)
+ f.a=a
+ f.ai=ai
+ f.centre=True
+
+ list.AddLast(f)
+ End Method
+
+ Method Clear()
+ list.Clear()
+ End Method
+
+ Method IsEmpty:Int()
+ Return list.IsEmpty()
+ End Method
+
+ Method Count:Int()
+ Return list.Count()
+ End Method
+
+ Method Process()
+ Local a:Float=GetAlpha()
+
+ For Local f:FontFadeEnt=EachIn list
+ If f.a<0.001 And f.ai<0
+ list.Remove(f)
+ Else
+ SetAlpha(f.a)
+
+ If f.centre
+ font.CentreColoured(f.s,f.y,f.r,f.g,f.b)
+ Else
+ font.DrawColoured(f.s,f.x,f.y,f.r,f.g,f.b)
+ EndIf
+
+ f.a:+f.ai
+ f.x:+f.dx
+ f.y:+f.dy
+
+ If f.a>1
+ f.a=1
+ f.ai=-f.ai
+ EndIf
+ EndIf
+ Next
+
+ SetAlpha(a)
+ End Method
+
+End Type
+
+Type FontFadeEnt
+ Field s:String
+ Field x:Float
+ Field y:Float
+ Field dx:Float
+ Field dy:Float
+ Field r,g,b:Int
+ Field a:Float
+ Field ai:Float
+ Field centre:Int
+End Type \ No newline at end of file
diff --git a/main.bmx b/main.bmx
new file mode 100644
index 0000000..f360e90
--- /dev/null
+++ b/main.bmx
@@ -0,0 +1,167 @@
+'
+' Main code for NutterShoot
+'
+' $Id$
+'
+
+Strict
+Import noddybox.bitmapfont
+
+' Includes
+'
+Include "font_fade.bmx"
+
+' Included binaries
+'
+Incbin "GFX/font.bmf"
+Incbin "GFX/font_shadow.bmf"
+Incbin "GFX/backdrop.bmp"
+
+SetGraphicsDriver GLMax2DDriver()
+Graphics 800,600,32,60
+HideMouse
+
+SetBlend(ALPHABLEND)
+
+' Globals
+'
+Global font:BitmapFont=BitmapFont.Load("incbin::GFX/font.bmf",0)
+Global font_shadow:BitmapFont=BitmapFont.Load("incbin::GFX/font_shadow.bmf",0)
+Global quit:Int=True
+Global fade:FontFade=FontFade.Create(font)
+Global fade_shadow:FontFade=FontFade.Create(font_shadow)
+Global bdrop:TImage=LoadImage("incbin::GFX/backdrop.bmp",0)
+
+SetImageHandle(bdrop,400,300)
+
+Intro()
+
+MainMenu()
+
+While Not quit
+ MainMenu()
+Wend
+
+End
+
+Function StartPage(bground:Int=True,sx:Float=1,sy:Float=1)
+ Cls
+ If bground
+ Local x:Float,y:Float,r:Float,a:Float
+ a=GetAlpha()
+ r=GetRotation()
+ GetScale(x,y)
+
+ SetAlpha(2)
+ SetTransform(0,sx,sy)
+ DrawImage(bdrop,400,300)
+ SetAlpha(a)
+ SetTransform(r,x,y)
+ EndIf
+End Function
+
+
+Function EndPage(flush:Int=True)
+ If flush Then FlushMem
+ Flip
+End Function
+
+
+Function Intro()
+ Local c=20
+ Local a$
+ Local f:FontFade=fade_shadow
+
+ SetTransform(0,2,2)
+
+ RestoreData intro_data
+
+ While Not KeyHit(KEY_SPACE)
+ StartPage()
+
+ c:-1
+
+ If c=0
+ c=20
+
+ ReadData a$
+
+ If a$="XXX"
+ RestoreData intro_data
+ c=200
+ Else
+ f.Centre(a$,500,$ffff80,0,0.008,-2)
+ EndIf
+ EndIf
+
+ f.Process()
+
+ EndPage()
+ Wend
+ SetTransform(0,1,1)
+End Function
+
+
+Function MainMenu()
+End Function
+
+
+Rem
+sc=10
+t$="THIS IS SOME VERY, VERY, *VERY* ~~LARGE SCROLLING TEXT....."
+x#=0
+ang#=0
+angi#=0.2
+
+While Not KeyHit(KEY_ESCAPE)
+ Cls
+
+ For f=0 Until NO
+ st[f].Update()
+ Next
+
+ SetTransform(ang,sc,sc)
+
+ ang:+angi
+
+ If ang<=-10 Or ang>=10 Then angi=-angi
+
+ fnt.DrawColoured(t$,x,0,255,255,255)'128,128)
+
+ If Not KeyDown(KEY_P)
+ x:-5
+
+ If x<-fnt.TextWidth(t[0..1])
+ x:+fnt.TextWidth(t[0..1])
+ t=t[1..]+t[0..1]
+ EndIf
+ EndIf
+
+ FlushMem
+
+ Flip
+
+Wend
+
+End Rem
+
+
+' PROGRAM DATA
+'
+#intro_data
+ DefData "NUTTER SHOOT"
+ DefData " "
+ DefData "(C) IAN C 2005"
+ DefData " "
+ DefData "THIS IS FREE SOFTWARE."
+ DefData "SEE THE GNU GENERAL"
+ DefData "PUBLIC LICENSE FOR"
+ DefData "DETAILS."
+ DefData " "
+ DefData " "
+ DefData "PRESS SPACE TO PLAY"
+ DefData " "
+ DefData " "
+ DefData "DEVELOPED WITH BLITZMAX"
+ DefData "HTTP://WWW.BLITZBASIC.COM"
+ DefData "XXX"