;*****************************************************************************************************
; Progam name : Initialize.pb
; Version     : 1.00
; Build       : 0001
; PB Version  : 5.62
; Auther      : B.J.Fernhout.
; Copyright   : None
; Date        : 2018
; Discription : Make all graphics and sounds work together
;             :
;             :
;*****************************************************************************************************

CText("Loading Graphics",320,240)

;Load all images
Global Im_BKF_FONT     = LoadImage(#PB_Any,"graphics\BKF-FONT.bmp")
Global Im_Jewels       = LoadImage(#PB_Any,"graphics\Jewels.bmp")
Global Im_Explosion    = LoadImage(#PB_Any,"graphics\explosion32.bmp")
Global Im_MainScreen   = LoadImage(#PB_Any,"graphics\MainScreen.bmp")
Global Im_Highscore    = LoadImage(#PB_Any,"graphics\Highscore.bmp")
Global Im_Font         = LoadImage(#PB_Any,"graphics\font.bmp")
Global Im_HowTo        = LoadImage(#PB_Any,"graphics\HowTo.bmp")
Global Im_Game_Over    = LoadSprite(#PB_Any,"graphics\Game_Over.bmp")
Global Im_Cursor       = LoadSprite(#PB_Any,"graphics\Cursor.bmp")
Global Im_Get_Ready    = LoadSprite(#PB_Any,"graphics\GetReady.bmp")
;Grabbing images file here
Global Im_TheLine ;= CreateImage(#PB_Any,640,1)
Global Im_BackUpScreen; = CreateImage(#PB_Any,640,480)
;load music And sounds
Global Snd_Colums       = LoadSound(#PB_Any,"Sound\Columns.wav")
Global Snd_Battle       = LoadSound(#PB_Any,"Sound\Nu Battle.wav")
Global Snd_Explosion    = LoadSound(#PB_Any,"Sound\Explosion.wav")
Global Snd_Drop         = LoadSound(#PB_Any,"Sound\Drop.wav")
Global Snd_HighScore    = LoadSound(#PB_Any,"Sound\HighScore.wav")
Global Snd_Aww          = LoadSound(#PB_Any,"Sound\awwww.wav")

Global x,y,FT_Num,sx,speed,o.f,t,i,si,skip
For x = 0 To 6
  ;Jewcolors(x) =CreateImage(#PB_Any,32,32)
  JewColors(x) =GrabImage(Im_Jewels,#PB_Any,x*32,0,32,32)
Next
;Get all the explosion sequence
For x = 0 To 10
  ;CreateImage(explosions(x),32,32)
  explosions(x) =GrabImage(Im_Explosion,#PB_Any,x*32,y,32,32)
Next
;Get all the big fonts
FT_Num = 1
For y = 0 To 3
  For x = 0 To 10
    ;CreateImage(fonts(FT_num),32,32)
    fonts(FT_num) = GrabImage(Im_font,#PB_Any,x*32,Y*32,32,28)
    FT_num+1
  Next
Next
;get smal fonts
FT_Num = 1
For Y = 0 To 2
  For x = 0 To 19
    ;CreateImage(SmalFonts(FT_num),16,16)
    SmalFonts(FT_num) = GrabImage(Im_BKF_FONT,#PB_Any,x*16,y*16,16,16)
    FT_num+1
  Next
Next
;Main intro loop
active_case = 1




; IDE Options = PureBasic 5.62 (Windows - x64)
; CursorPosition = 41
; FirstLine = 4
; EnableXP
; CompileSourceDirectory
; EnableCompileCount = 0
; EnableBuildCount = 0
; EnableExeConstant