summaryrefslogtreecommitdiff
path: root/global.bmx
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-05-02 22:50:22 +0000
committerIan C <ianc@noddybox.co.uk>2006-05-02 22:50:22 +0000
commit1c900457e45e70e12a04b2c5b909e0bd9a9d8a3e (patch)
tree156ccafdee5dcea718f8b7a3930c38a9158749b1 /global.bmx
parentc93d5990b230175597557978d0bc2c094bee3bdb (diff)
Updates
Diffstat (limited to 'global.bmx')
-rw-r--r--global.bmx73
1 files changed, 70 insertions, 3 deletions
diff --git a/global.bmx b/global.bmx
index dedad10..b120af7 100644
--- a/global.bmx
+++ b/global.bmx
@@ -38,6 +38,7 @@ Incbin "GFX/exhaust.png"
Incbin "GFX/flame.png"
Incbin "GFX/star.png"
Incbin "GFX/asteroid.png"
+Incbin "GFX/fireball.png"
Const HERTZ:Int=70
@@ -56,7 +57,7 @@ Type GFX
Global flame:TImage
Global star:TImage
Global asteroid:TImage
- Global explosion:TImage
+ Global fireball:TImage
Function SafeLoadImage:TImage(p:String, mode:Int)
Local i:TImage=LoadImage(p,mode)
@@ -92,6 +93,9 @@ Type GFX
asteroid=SafeLoadImage("incbin::GFX/asteroid.png",FILTEREDIMAGE)
MidHandleImage(asteroid)
+
+ fireball=SafeLoadImage("incbin::GFX/fireball.png",FILTEREDIMAGE)
+ SetImageHandle(fireball,7,7)
End Function
End Type
@@ -181,12 +185,20 @@ Type Scroller
Global msgx:Int
Function Init()
+ Rem
msg=" "
- msg:+"DURING A TEST-FLIGHT OF THE STAR-FIGHTER XY-9 YOU ARE AMBUSHED IN THE ASTEROID FIELD OUTSIDE OF MARS... "
+ msg:+"DURING A TEST-FLIGHT OF THE STAR-FIGHTER OGL-X YOU ARE AMBUSHED IN THE ASTEROID FIELD OUTSIDE OF MARS... "
msg:+"THE EVIL EMPIRE CANNOT BE ALLOWED TO DESTROY THE PROTOTYPE SO YOU MUST PILOT THE WEAPONLESS CRAFT, "
msg:+"AVOIDING THE DEADLY MISSILES UNTIL HELP ARRIVES... "
msg:+"SHOW HEART YOUNG PILOT, STAR-FLEET IS DEPENDING UPON YOU!"
-
+ EndRem
+
+ msg=" "
+ msg:+"IT IS A TIME OF WAR. IN A LAST DITCH ATTEMPT TO WIN A LOSING WAR THAT HAS RAGED THROUGH THE GALAXY AGAINST THE EVIL EMPIRE "
+ msg:+"A NEW SHIP, THE DX-9, HAS BEEN DEVELOPED. ON A ROUTINE TEST FLIGHT THE SHIP HAS BEEN AMBUSHED IN AN ASTEROID FIELD. "
+ msg:+"WEAPONLESS, YOU MUST PILOT THE DX-9 AND AVOID THE EMPIRE'S MISSILE SALVOS AMONGST THE ASTEROIDS... HELP WILL ARRIVE EVENTUALLY, "
+ msg:+"BUT UNTIL THEN YOU ARE OUR LAST HOPE. IF THE DX-9 IS LOST THEN SO IS THE EARTH. EARTH IS DEPENDING ON YOU!!!"
+
msgx=0
msgp=0
End Function
@@ -202,6 +214,49 @@ Type Scroller
End Function
End Type
+Type VText
+ Field t:String
+ Field y:Int
+
+ Function Create:VText(t:String, y:Int)
+ Local o:VText=New VText
+ o.t=t
+ o.y=y
+ Return o
+ End Function
+End Type
+
+Type VerticalScroller
+ Global msg:TList
+ Global maxy:Int
+
+ Method New()
+ msg=CreateList()
+ maxy=0
+ End Method
+
+ Method Add(s:String)
+ SetScale(2,2)
+ msg.AddLast(VText.Create(s,maxy+800))
+ maxy:+GFX.font.TextHeight(s)
+ SetScale(1,1)
+ End Method
+
+ Method Draw()
+ SetScale(2,2)
+ For Local o:VText=EachIn msg
+ o.y:-1
+ If o.y<-GFX.font.TextHeight(o.t)
+ o.y:+maxy
+ EndIf
+ If o.y<799
+ GFX.font.Centre(o.t,o.y)
+ EndIf
+ Next
+ SetScale(1,1)
+ End Method
+End Type
+
Type Thanks
Global item:String[]
Global i:Int
@@ -259,6 +314,18 @@ Type TFadeScreen
Return Create(1,-0.05)
End Function
+ Function DoFadeIn()
+ Local fade:TFadeScreen=TFadeScreen.FadeIn()
+ Local pm:TPixmap=GrabPixmap(0,0,GraphicsWidth(),GraphicsHeight())
+
+ While fade.Fade()
+ Cls
+ DrawPixmap(pm,0,0)
+ fade.Draw()
+ Flip
+ Wend
+ End Function
+
Function DoFadeOut()
Local fade:TFadeScreen=TFadeScreen.FadeOut()
Local pm:TPixmap=GrabPixmap(0,0,GraphicsWidth(),GraphicsHeight())