;*****************************************************************************************************
; Progam name : Colums_main.pb (Colums) 
; Version     : 1.00
; Build       : 0001
; PB Version  : 5.62
; Auther      : B.J.Fernhout.
; Copyright   : None
; Date        : 2018 
; Discription : A remake of the game made in Darkbasic. And from there the original game was colors
;             : That game was from the amiga. The Original game is lost by me. So i can't credit
;             : the original maker. May thanks to him/her
;*****************************************************************************************************

Global systemFailure = #False 

If InitKeyboard() = 0 : SystemFailure = #True : EndIf
If InitSprite() = 0 : systemfailure = #True : EndIf
If InitMouse() = 0 : systemfailure = #True : EndIf
If InitSound() = 0 : SystemFailure = #True : EndIf  

;OpenWindow(0, 0, 0, 640, 480, "Colums", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
;Global ScreenID = OpenWindowedScreen(WindowID(0), 0, 0, 640, 480,0,0,0,#PB_Screen_NoSynchronization)
;OpenScreen(640,480,32,"Colums",#PB_Screen_NoSynchronization)
If OpenScreen(640,480,32,"Colums",#PB_Screen_NoSynchronization) = 0 : SystemFailure = #True : EndIf
If SystemFailure
  MessageRequester("Error!", "Unable to Initialize game settings.", #PB_MessageRequester_Ok)
  End
EndIf

XIncludeFile "Init.pb"
XIncludeFile "CenterText.pb"
XIncludeFile "Button3D.pb"
XIncludeFile "Initialize.pb"
XIncludeFile "MSGBox.pb"
XIncludeFile "Intro_Screen.pb"
XIncludeFile "Fireworks.pb"
XIncludeFile "HighScore.pb"
XIncludeFile "Doplay.pb"
XIncludeFile "GameOverQuit.pb"

;=====================================================================================================
; Main game loop
;=====================================================================================================
Repeat
  Select Active_Case
    Case 1  ;Intro screen
      intro()
    Case 2  ;Fireworks
      DoFirework()
    Case 3  ;High score
      DoHighScore()
    Case 4 ;Show HowTo
      HowTo()
    Case 5  ;Init new game
      DoInit()
    Case 6  ;Play game
      DoPlay()
    Case 7  ;Game over
      DoGameOver()
    Case 25 ;Quit game
      DoQuit()
  EndSelect
  
ForEver
; IDE Options = PureBasic 5.62 (Windows - x64)
; CursorPosition = 28
; EnableXP
; CompileSourceDirectory
; EnableCompileCount = 0
; EnableBuildCount = 0
; EnableExeConstant