'________________________________________________________'
' Constants:
fps = 30 ' Starting scrolled up lines per second
steer = 2 ' How fast craft steers
stgNum = 5 ' Number of ravine stages to endure
widthInit = 15 ' Ravine's initial half width
distMax = 2000 ' Ravine's total length of lines for each stage
confLoad = "True"
confSave = "True"
' The following line could be harmful and has been automatically commented.
' confPath = File.GetSettingsFilePath()
'________________________________________________________'
' Initialization:
TextWindow.Top = 250
TextWindow.BackgroundColor = "Green"
TextWindow.ForegroundColor = "Black"
TextWindow.Clear()
ASCIIData()
StoryData()
ReadArgs()
ConfigData()
distPercent = Math.Floor(distMax/100) ' 1% of distMax
i = 0 ' Resets iterator for Sub StoryDisplay
Timer.Tick = StoryDisplay
Timer.Interval = 1500 ' Activates timer to display the story
'Even though execution is temporarily paused, the timer thread keeps going:
TextWindow.PauseWithoutMessage()
ResetGame()
DisplayInstructions()
'________________________________________________________'
Start:
If stg >= stgNum Then
Victory()
EndIf
EndSub
'________________________________________________________'
Sub Victory
ResetGame()
TextWindow.WriteLine(LF+" CONGRATULATIONS!!!")
TextWindow.WriteLine(" You've proved the impossible wrong!"+LF)
TextWindow.WriteLine(" You've survived Death Valley")
TextWindow.WriteLine("and escaped the odious Dissectitrons!"+LF)
Sound.PlayMusic("t120s8m5 l8 o4 g.ga16g. l16 gab o5 c8")
Program.Delay(5000)
TextWindow.Pause()
EndSub
'________________________________________________________'
Sub RefreshVars
isAlive = "True"
spd = fps
dist = distMax
offSet = 80/2 - width ' Init. dist. between text window's left & left wall
wallLeft = width ' Init. distance between left wall & ship
wallRight= width ' Init. distance between ship & right wall
valley = 1 + wallLeft + 1 + wallRight + 1
widthMax = 80 - valley
EndSub
'________________________________________________________'
Sub StoryData
t[1] = " There is only one way to escape"
t[2] = "the forces of the evil Dissectitrons." + LF
t[3] = " You will have to steel every nerve"
t[4] = "and fly your single-seater Speed Dart"
t[5] = "along the jagged, bottomless ravine"
t[6] = "known as Death Valley." + LF
t[7] = " The valley starts reasonably large,"
t[8] = "but as you venture further in,"
t[9] = "it gets impossibly very narrower!" + LF
t[10] = " Steer your craft using the keyboard,"
t[11] = "and see if you can make it safely"
t[12] = "through Death Valley." + LF
t[13] = "Good luck!!!" + LF
t[14] = "Press any key to start..." + LF
textLines = Array.GetItemCount(t)
EndSub
'________________________________________________________'
Sub StoryDisplay
i = i + 1
TextWindow.WriteLine(t[i])
Sound.PlayClick()
If i >= textLines Then
Timer.Pause()
EndIf
EndSub
'________________________________________________________'
Sub DisplayInstructions
TextWindow.CursorTop = 7
TextWindow.WriteLine(" Press 'Q' or 'A' to steer to left,")
TextWindow.WriteLine(" and any other to steer to right."+LF+LF+LF)
TextWindow.WriteLine(" Fly safe! ;-)"+LF+LF)
TextWindow.Pause()
EndSub
'________________________________________________________'
Sub ConfigData
If confLoad Then
' The following line could be harmful and has been automatically commented.
' confs = File.ReadContents(confPath)
EndIf
If confs <> "" Then
ConfigRead()
Else
ConfigDump()
EndIf
If confSave Then
' The following line could be harmful and has been automatically commented.
' File.WriteContents(confPath, confs)
EndIf
EndSub
'________________________________________________________'
Sub ConfigRead