summaryrefslogtreecommitdiff
path: root/main.bmx
blob: f360e905db0a9f1122045043560a9fcc85396b31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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"