'This BMX file was edited with BLIde ( http://www.blide.org )

Global WeaponSlot1:Weapon
Global WeaponSlot2:Weapon








fileu = ReadFile("Options.txt")
width = ReadFloat(fileu)
height = ReadFloat(fileu)
Global Music:Float = 0.5
Global Sound:Float = 1
CloseFile(fileu)


 width = 1280
 height = 1024

 wp = width / 1280.0
 hp = height / 1024.0
 
ButtonText[0] = "Continue company"
ButtonText[1] = "Single game"
ButtonText[2] = "Top 10"
ButtonText[3] = "Options"
ButtonText[4] = "About"
ButtonText[5] = "Exit"
ButtonText[6] = "Missions"
ButtonText[7] = "Garage"
ButtonText[8] = "Shop"


'KEY FOR A GAME
KeyUp1 = KEY_W
KeyUp2 = KEY_UP
KeyDown1 = KEY_S
KeyDown2 = KEY_DOWN
KeyLeft1 = KEY_LEFT
KeyLeft2 = KEY_A
KeyRight1 = KEY_RIGHT
KeyRight2 = KEY_D
KeyEnter1 = KEY_ENTER
KeyEnter2 = KEY_Z
KeySecAttack1 = KEY_LSHIFT
KeySecAttack2 = KEY_X


'Weapons
WeaponSlot1:Weapon = BulletLauncher



'Score
Global CompanyScore
Global LocScore = 100
Global ShowScore


'Upgrades
Global WeaponyUp
Global ArmoryUp
Global EnergyUp

Global ChatMessages:String[] = New String[4]
ChatMessages[0] = "Hello"
ChatMessages[1] = "my"
ChatMessages[2] = "friend"
ChatMessages[3] = "!!!"


Global Different:Float = 0


Type TEntity
        Field link:TLink
        Method remove()
                link.remove
                Sila:-1
        End Method
        Method AddLast( list:TList )
                link=list.AddLast( Self )
        End Method
        Method Update() Abstract
End Type


Type Stars  Extends TEntity
	Field img:TImage
	Field x
	Field y
	Field speed:Float
	
	Function CreateStars:Stars(img:TImage, x, y, speed:Float)
        Local star:Stars = New Stars
		star.img = img
		star.x = x
		star.y = y
		star.speed = speed
		star.AddLast SEntities
	End Function
	
	Method Update()
		 y = y + speed
		 If (y > height) Then
		 	   y = 0
		 EndIf
		 SetScale(width / img.width, height / img.height)
		 DrawImage(img, x, y - height)
		 DrawImage(img, x, y)
		 SetScale(1, 1)
	End Method
	
End Type
  
Type FPSCounter
	Field _fps_start:Float
    Field _fps_count:Float

    Field _avfps_start:Float
    Field _fps_average_count:Float

    Field fps:Float
    Field fps_average#  

    Field fps_min:Float = 1000
    Field fps_max:Float = 0

	
	 Method Start()

        Local ms# = MilliSecs()

        If _fps_start = 0 Then _fps_start = ms
        If _avfps_start = 0 Then _avfps_start = ms

    EndMethod

    Method Finish()

        Local millis# = MilliSecs()
        Local time# = millis - _fps_start

        _fps_count :+ 1

        If time > 1000

            fps = _fps_count*1000/time

            If fps < fps_min Then fps_min = fps
            If fps > fps_max Then fps_max = fps

            _fps_start = 0
            _fps_count = 0

        EndIf

        _fps_average_count :+ 1

        time = millis - _avfps_start

        If time > 1000
            fps_average = _fps_average_count * 1000 / time
        EndIf

    EndMethod
End Type



