Jump to content
Sign in to follow this  
TheNorwegianUser

Need help with Timer for Hall of Fame

Recommended Posts

TheNorwegianUser

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F5}", "ChangeScreenSize")

Local $Timer=0, $CurrentState=0


$Gui=GUICreate("", 1200, 800)

#region Stage 1
Local $HorizontalBad1x=-100
Local $HorizontalBad2x=1200
Local $HorizontalBad3x=-100
Local $HorizontalBad4x=1200
Local $HorizontalBad5x=-100
Local $HorizontalBad6x=1200
Local $HorizontalBad7x=-100
Local $HorizontalBad8x=1200
$HorizontalBad1=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 0, 100, 100)
$HorizontalBad2=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 100, 100, 100)
$HorizontalBad3=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 200, 100, 100)
$HorizontalBad4=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 300, 100, 100)
$HorizontalBad5=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 400, 100, 100)
$HorizontalBad6=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 500, 100, 100)
$HorizontalBad7=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 600, 100, 100)
$HorizontalBad8=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 700, 100, 100)
Local $VerticalBad1y=-100
Local $VerticalBad2y=800
Local $VerticalBad3y=-100
Local $VerticalBad4y=800
Local $VerticalBad5y=-100
Local $VerticalBad6y=800
Local $VerticalBad7y=-100
Local $VerticalBad8y=800
Local $VerticalBad9y=-100
Local $VerticalBad10y=800
Local $VerticalBad11y=-100
Local $VerticalBad12y=800
$VerticalBad1=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad2=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad3=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad4=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad5=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad6=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad7=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad8=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad9=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad10=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad11=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad12=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$PointLabel=GUICtrlCreateLabel("", 50, 330, 1150, 300)
GUICtrlSetFont(-1, 35, 0, 0, "Comic Sans MS")
GUICtrlSetState($PointLabel, $GUI_HIDE)
$ContinueLabel=GUICtrlCreateLabel("Click to continue", 100, 700, 300, 50)
GUICtrlSetFont(-1, 20, 0, 0, "Comic Sans MS")
GUICtrlSetState($ContinueLabel, $GUI_HIDE)
$Highscorelabel=GUICtrlCreateLabel("", 50, 0, 1150, 300)
GUICtrlSetFont(-1, 25, 0, 0, "Comic Sans MS")
GUICtrlSetState($Highscorelabel, $GUI_HIDE)
#endregion Stage 1

$Label1=GUICtrlCreateLabel("Click to start!", 230, 330, 1000, 200)
GUICtrlSetFont(-1, 60, 0, 0, "Comic Sans MS")

GUISetState()
GameMenu()





While 1
    $MousePos=GUIGetCursorInfo($Gui)
    If $MousePos[0]<0 or $MousePos[1]<0 or $MousePos[0]>1200 or $MousePos[1]>800 Then Restartgame()
    If $MousePos[4]<>0 Then Restartgame()
    $msg=GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    Switch $CurrentState
        Case 0
            Case0()
    EndSwitch
WEnd

Func Case0()
    $Steps=1
    If TimerDiff($Timer)>10000 Then $Steps=2
    If TimerDiff($Timer)>20000 Then $Steps=3
    If TimerDiff($Timer)>40000 Then $Steps=4
    If TimerDiff($Timer)>80000 Then $Steps=5
    If TimerDiff($Timer)>120000 Then $Steps=6

    Sleep(1)
    If $MousePos[1]<100 and $MousePos[1]>0 Then
        If $MousePos[0]-50>$HorizontalBad1x Then $HorizontalBad1x+=$Steps
        If $MousePos[0]-50<$HorizontalBad1x Then $HorizontalBad1x-=$Steps
        GUICtrlSetPos($HorizontalBad1, $HorizontalBad1x, 0)
    EndIf
    If $MousePos[1]<200 and $MousePos[1]>100 Then
        If $MousePos[0]-50>$HorizontalBad2x Then $HorizontalBad2x+=$Steps
        If $MousePos[0]-50<$HorizontalBad2x Then $HorizontalBad2x-=$Steps
        GUICtrlSetPos($HorizontalBad2, $HorizontalBad2x, 100)
    EndIf
    If $MousePos[1]<300 and $MousePos[1]>200 Then
        If $MousePos[0]-50>$HorizontalBad3x Then $HorizontalBad3x+=$Steps
        If $MousePos[0]-50<$HorizontalBad3x Then $HorizontalBad3x-=$Steps
        GUICtrlSetPos($HorizontalBad3, $HorizontalBad3x, 200)
    EndIf
    If $MousePos[1]<400 and $MousePos[1]>300 Then
        If $MousePos[0]-50>$HorizontalBad4x Then $HorizontalBad4x+=$Steps
        If $MousePos[0]-50<$HorizontalBad4x Then $HorizontalBad4x-=$Steps
        GUICtrlSetPos($HorizontalBad4, $HorizontalBad4x, 300)
    EndIf
    If $MousePos[1]<500 and $MousePos[1]>400 Then
        If $MousePos[0]-50>$HorizontalBad5x Then $HorizontalBad5x+=$Steps
        If $MousePos[0]-50<$HorizontalBad5x Then $HorizontalBad5x-=$Steps
        GUICtrlSetPos($HorizontalBad5, $HorizontalBad5x, 400)
    EndIf
    If $MousePos[1]<600 and $MousePos[1]>500 Then
        If $MousePos[0]-50>$HorizontalBad6x Then $HorizontalBad6x+=$Steps
        If $MousePos[0]-50<$HorizontalBad6x Then $HorizontalBad6x-=$Steps
        GUICtrlSetPos($HorizontalBad6, $HorizontalBad6x, 500)
    EndIf
    If $MousePos[1]<700 and $MousePos[1]>600 Then
        If $MousePos[0]-50>$HorizontalBad7x Then $HorizontalBad7x+=$Steps
        If $MousePos[0]-50<$HorizontalBad7x Then $HorizontalBad7x-=$Steps
        GUICtrlSetPos($HorizontalBad7, $HorizontalBad7x, 600)
    EndIf
    If $MousePos[1]<800 and $MousePos[1]>700 Then
        If $MousePos[0]-50>$HorizontalBad8x Then $HorizontalBad8x+=$Steps
        If $MousePos[0]-50<$HorizontalBad8x Then $HorizontalBad8x-=$Steps
        GUICtrlSetPos($HorizontalBad8, $HorizontalBad8x, 700)
    EndIf
    If $MousePos[0]<100 and $MousePos[0]>0 Then
        If $MousePos[1]-50>$VerticalBad1y Then $VerticalBad1y+=$Steps
        If $MousePos[1]-50<$VerticalBad1y Then $VerticalBad1y-=$Steps
        GUICtrlSetPos($VerticalBad1, 0, $VerticalBad1y)
    EndIf
    If $MousePos[0]<200 and $MousePos[0]>100 Then
        If $MousePos[1]-50>$VerticalBad2y Then $VerticalBad2y+=$Steps
        If $MousePos[1]-50<$VerticalBad2y Then $VerticalBad2y-=$Steps
        GUICtrlSetPos($VerticalBad2, 100, $VerticalBad2y)
    EndIf
    If $MousePos[0]<300 and $MousePos[0]>200 Then
        If $MousePos[1]-50>$VerticalBad3y Then $VerticalBad3y+=$Steps
        If $MousePos[1]-50<$VerticalBad3y Then $VerticalBad3y-=$Steps
        GUICtrlSetPos($VerticalBad3, 200, $VerticalBad3y)
    EndIf
    If $MousePos[0]<400 and $MousePos[0]>300 Then
        If $MousePos[1]-50>$VerticalBad4y Then $VerticalBad4y+=$Steps
        If $MousePos[1]-50<$VerticalBad4y Then $VerticalBad4y-=$Steps
        GUICtrlSetPos($VerticalBad4, 300, $VerticalBad4y)
    EndIf
    If $MousePos[0]<500 and $MousePos[0]>400 Then
        If $MousePos[1]-50>$VerticalBad5y Then $VerticalBad5y+=$Steps
        If $MousePos[1]-50<$VerticalBad5y Then $VerticalBad5y-=$Steps
        GUICtrlSetPos($VerticalBad5, 400, $VerticalBad5y)
    EndIf
    If $MousePos[0]<600 and $MousePos[0]>500 Then
        If $MousePos[1]-50>$VerticalBad6y Then $VerticalBad6y+=$Steps
        If $MousePos[1]-50<$VerticalBad6y Then $VerticalBad6y-=$Steps
        GUICtrlSetPos($VerticalBad6, 500, $VerticalBad6y)
    EndIf
    If $MousePos[0]<700 and $MousePos[0]>600 Then
        If $MousePos[1]-50>$VerticalBad7y Then $VerticalBad7y+=$Steps
        If $MousePos[1]-50<$VerticalBad7y Then $VerticalBad7y-=$Steps
        GUICtrlSetPos($VerticalBad7, 600, $VerticalBad7y)
    EndIf
    If $MousePos[0]<800 and $MousePos[0]>700 Then
        If $MousePos[1]-50>$VerticalBad8y Then $VerticalBad8y+=$Steps
        If $MousePos[1]-50<$VerticalBad8y Then $VerticalBad8y-=$Steps
        GUICtrlSetPos($VerticalBad8, 700, $VerticalBad8y)
    EndIf
    If $MousePos[0]<900 and $MousePos[0]>800 Then
        If $MousePos[1]-50>$VerticalBad9y Then $VerticalBad9y+=$Steps
        If $MousePos[1]-50<$VerticalBad9y Then $VerticalBad9y-=$Steps
        GUICtrlSetPos($VerticalBad9, 800, $VerticalBad9y)
    EndIf
    If $MousePos[0]<1000 and $MousePos[0]>900 Then
        If $MousePos[1]-50>$VerticalBad10y Then $VerticalBad10y+=$Steps
        If $MousePos[1]-50<$VerticalBad10y Then $VerticalBad10y-=$Steps
        GUICtrlSetPos($VerticalBad10, 900, $VerticalBad10y)
    EndIf
    If $MousePos[0]<1100 and $MousePos[0]>1000 Then
        If $MousePos[1]-50>$VerticalBad11y Then $VerticalBad11y+=$Steps
        If $MousePos[1]-50<$VerticalBad11y Then $VerticalBad11y-=$Steps
        GUICtrlSetPos($VerticalBad11, 1000, $VerticalBad11y)
    EndIf
    If $MousePos[0]<1200 and $MousePos[0]>1100 Then
        If $MousePos[1]-50>$VerticalBad12y Then $VerticalBad12y+=$Steps
        If $MousePos[1]-50<$VerticalBad12y Then $VerticalBad12y-=$Steps
        GUICtrlSetPos($VerticalBad12, 1100, $VerticalBad12y)
    EndIf
EndFunc

Func GameMenu()
    GUICtrlSetState($Label1, $GUI_SHOW)


    While 1
        If _IsPressed(01) Then
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]<800 and $MousePos[1]>0 and $MousePos[0]>0 and $MousePos[0]<1200 Then ExitLoop
        EndIf
    WEnd



    GUICtrlSetState($Label1, $GUI_HIDE)
    $CurrentState=0
    $HorizontalBad1x=-100
    $HorizontalBad2x=1200
    $HorizontalBad3x=-100
    $HorizontalBad4x=1200
    $HorizontalBad5x=-100
    $HorizontalBad6x=1200
    $HorizontalBad7x=-100
    $HorizontalBad8x=1200
    $VerticalBad1y=-100
    $VerticalBad2y=800
    $VerticalBad3y=-100
    $VerticalBad4y=800
    $VerticalBad5y=-100
    $VerticalBad6y=800
    $VerticalBad7y=-100
    $VerticalBad8y=800
    $VerticalBad9y=-100
    $VerticalBad10y=800
    $VerticalBad11y=-100
    $VerticalBad12y=800
    $Timer=TimerInit()
EndFunc

Func Restartgame()
    $FinalTime=TimerDiff($Timer)
    GUICtrlSetPos($HorizontalBad1, -100, 0)
    GUICtrlSetPos($HorizontalBad2, 1200, 100)
    GUICtrlSetPos($HorizontalBad3, -100, 200)
    GUICtrlSetPos($HorizontalBad4, 1200, 300)
    GUICtrlSetPos($HorizontalBad5, -100, 400)
    GUICtrlSetPos($HorizontalBad6, 1200, 500)
    GUICtrlSetPos($HorizontalBad7, -100, 600)
    GUICtrlSetPos($HorizontalBad8, 1200, 700)
    GUICtrlSetPos($VerticalBad1, 0, -100)
    GUICtrlSetPos($VerticalBad2, 0, 800)
    GUICtrlSetPos($VerticalBad3, 0, -100)
    GUICtrlSetPos($VerticalBad4, 0, 800)
    GUICtrlSetPos($VerticalBad5, 0, -100)
    GUICtrlSetPos($VerticalBad6, 0, 800)
    GUICtrlSetPos($VerticalBad7, 0, -100)
    GUICtrlSetPos($VerticalBad8, 0, 800)
    GUICtrlSetPos($VerticalBad9, 0, -100)
    GUICtrlSetPos($VerticalBad10, 0, 800)
    GUICtrlSetPos($VerticalBad11, 0, -100)
    GUICtrlSetPos($VerticalBad12, 0, 800)
    $TimerDiff=TimerDiff($Timer)

    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "1st.", "0")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "2nd.", "0")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "3rd.", "0")
    While Not StringIsDigit($FinalTime)
        $FinalTime=StringTrimRight($FinalTime, 1)
    WEnd
    GUICtrlSetData($PointLabel, "Score: " & $FinalTime & " seconds")
    If $ReadIni1<>"0" Then
        $CheckTime=$ReadIni1
        $CheckTime2=$ReadIni2
        $CheckTime3=$ReadIni3

        While Not StringIsDigit($CheckTime)
            $CheckTime=StringTrimLeft($CheckTime, 1)
        WEnd
        While Not StringIsDigit($CheckTime2)
            $CheckTime2=StringTrimLeft($CheckTime2, 1)
        WEnd
        While Not StringIsDigit($CheckTime3)
            $CheckTime3=StringTrimLeft($CheckTime3, 1)
        WEnd
        If $CheckTime<$FinalTime Then
            $Name=InputBox("New High Score!", "What's your name?")
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "1st.", $Name & " " & $FinalTime)
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "2nd.", $ReadIni1)
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "3rd.", $ReadIni2)
        ElseIf $CheckTime2<$FinalTime Then
            $Name=InputBox("Second Place!", "What's your name?")
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "2nd.", $Name & " " & $FinalTime)
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "3rd.", $ReadIni2)
        ElseIf $CheckTime3<$FinalTime Then
            $Name=InputBox("Third Place!", "What's your name?")
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "3rd.", $Name & " " & $FinalTime)
        EndIf
    Else
        $Name=InputBox("New High Score!", "What's your name?")
        IniWrite(@ScriptDir & "\Score.ini", "Stage 1", "1st.", $Name & " " & $FinalTime)
    EndIf
    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "1st.", "0")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "2nd.", "0")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 1", "3rd.", "0")
    GUICtrlSetData($Highscorelabel, $ReadIni1 & @CRLF & $ReadIni2 & @CRLF & $ReadIni3)
    GUICtrlSetState($PointLabel, $GUI_SHOW)
    GUICtrlSetState($Highscorelabel, $GUI_SHOW)
    GUICtrlSetState($ContinueLabel, $GUI_SHOW)
    MsgBox(0, "", $CheckTime & @CRLF & $CheckTime2 & @CRLF & $CheckTime3 & @CRLF & $FinalTime)
    While 1
        If _IsPressed(01) Then
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]<800 and $MousePos[1]>0 and $MousePos[0]>0 and $MousePos[0]<1200 Then ExitLoop
        EndIf
    WEnd
    While _IsPressed(01)
    WEnd
    GUICtrlSetState($PointLabel, $GUI_HIDE)
    GUICtrlSetState($ContinueLabel, $GUI_HIDE)
    GUICtrlSetState($Highscorelabel, $GUI_HIDE)
    GameMenu()
EndFunc

Func Terminate()
    Exit
EndFunc

Func ChangeScreenSize()

EndFunc

I'm having trouble getting the hall of fame thing for my small game to work, at this place, it continues even though it isn't smaller..: If $CheckTime<$FinalTime Then

When I get more than 10 seconds it usually doesn't come in neither... To test it, just get some pictures and call them Bad1 and Bad2 in the same directory as the script.

 

EDIT::: I got that stuff to work, see post #10 for my other problem.

Edited by TheNorwegianUser

Share this post


Link to post
Share on other sites
spudw2k

...couldn't find a appropiate topic title, so just called it No Topic..

How about something remotly close to what your requesting?  Here are a few that come to mind....

"Help with Timer"

"Timer Help"

"Need help with Timer for Hall of Fame"

just sayin'

Why are you parsing the timer vars? (TrimLeft, TrimRight) You should not have to do that.

 

Kind of neat game idea though

Edited by spudw2k

Share this post


Link to post
Share on other sites
TheNorwegianUser

How about something remotly close to what your requesting?  Here are a few that come to mind....

"Help with Timer"

"Timer Help"

"Need help with Timer for Hall of Fame"

just sayin'

Why are you parsing the timer vars? (TrimLeft, TrimRight) You should not have to do that.

 

Kind of neat game idea though

Because it's in the same string as the name of the one that scored it from the .ini, and to remove the numbers behind the . from the timer, so it's just milliseconds :)

Share this post


Link to post
Share on other sites
willichan

The only place you are initializing $CheckTime, $CheckTime2 or $CheckTime3 with values is in an If statement, so they are not getting values.

Add the following to the top of the function

Func Restartgame()
 Local $CheckTime=""
 Local $CheckTime2=""
 Local $CheckTime3=""

Your script will run without errors after that.

A couple of other issues for you to look at:

You do not have a way to exit the game.  I had to kill it from the taskbar.

Your high score list does not sort, so you just keep replacing the last score regardless which is the higher score.

Edited by willichan

Share this post


Link to post
Share on other sites
TheNorwegianUser

The only place you are initializing $CheckTime, $CheckTime2 or $CheckTime3 with values is in an If statement, so they are not getting values.

Add the following to the top of the function

Func Restartgame()
 Local $CheckTime=""
 Local $CheckTime2=""
 Local $CheckTime3=""

Your script will run fine after that.

Another problem I encountered is that you do not have a way to exit the game.  I had to kill it from the taskbar.

Oh, I usually just set an esc hotkey for unfinished stuff ;)

Hmm, still didn't work fine, got 1666, and it didn't get on the list when another was 176, and 992 got on 1st when I alredy had 3157. (Small numbers cause I just test it..)

Share this post


Link to post
Share on other sites
willichan

Your high score list does not sort, so you just keep replacing the last score regardless which is the higher score.

Share this post


Link to post
Share on other sites
willichan

If you want to eliminate the need to parse the score lines as spudw2k mentioned, you might try storing the score and the player name separately.

example

[Stage1]
player1=willichan
score1=19491
player2=willichan
score2=14323
player3=TheNorwegianUser
score3=3157

Share this post


Link to post
Share on other sites
TheNorwegianUser

 

 

Hmm, can't figure it out :S

It first checks if it beat 1st, then 2nd, and then 3rd, writes it in the .ini, and then it reads the ini again to get the current score and puts it with 1st first and 3rd last?

 

 

If you want to eliminate the need to parse the score lines as spudw2k mentioned, you might try storing the score and the player name separately.

example

[stage1]

player1=willichan

score1=19491

player2=willichan

score2=14323

player3=TheNorwegianUser

score3=3157

 

Is that why it doesn't work? If not it isn't really that important, it leaves the correct number as far as I can see :S

Edited by TheNorwegianUser

Share this post


Link to post
Share on other sites
willichan

The way you have it, score 1 is not neccesarily the highest score. You need to make sure you sort them high to low.

This is the INI file after four quick runs.

[Stage 1]
1st.=aaa 3983
2nd.=bbb 1729
3rd.=ddd 12251

 

The INI example I gave is a different issue.  It is for efficiency and easier coding, rather than needing to parse the score from the name each and every time.

Share this post


Link to post
Share on other sites
TheNorwegianUser

The way you have it, score 1 is not neccesarily the highest score. You need to make sure you sort them high to low.

This is the INI file after four quick runs.

[Stage 1]
1st.=aaa 3983
2nd.=bbb 1729
3rd.=ddd 12251

The INI example I gave is a different issue.  It is for efficiency and easier coding, rather than needing to parse the score from the name each and every time.

Thanks, got that working. But I got another problem... My antivirus program reacts because of something with iniwrite or iniread, at least I think that's the problem. Cause when I compile and run it with the things that have ;~ in front of it in the script now, it deleted the program, but when I compiled and ran it like it is now, it didn't...

EDIT: I'm currently on my school computer, seems like they have locked the settings for my virusprogram, so can't really do much about it from there. Anything I can change in the script instead?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
FileInstall("C:\Users\elias-stokland\Documents\Autoit\Bad1.jpg", @ScriptDir & "\Bad1.jpg")
FileInstall("C:\Users\elias-stokland\Documents\Autoit\Bad2.jpg", @ScriptDir & "\Bad2.jpg")
FileInstall("C:\Users\elias-stokland\Documents\Autoit\Bad3.jpg", @ScriptDir & "\Bad3.jpg")
FileInstall("C:\Users\elias-stokland\Documents\Autoit\Bad4.jpg", @ScriptDir & "\Bad4.jpg")
Local $Timer=0, $CurrentState=0


$Gui=GUICreate("Spillet", 1200, 800)

#region Stage 0
Local $HorizontalBad1x=-100
Local $HorizontalBad2x=1200
Local $HorizontalBad3x=-100
Local $HorizontalBad4x=1200
Local $HorizontalBad5x=-100
Local $HorizontalBad6x=1200
Local $HorizontalBad7x=-100
Local $HorizontalBad8x=1200
$HorizontalBad1=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 0, 100, 100)
$HorizontalBad2=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 100, 100, 100)
$HorizontalBad3=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 200, 100, 100)
$HorizontalBad4=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 300, 100, 100)
$HorizontalBad5=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 400, 100, 100)
$HorizontalBad6=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 500, 100, 100)
$HorizontalBad7=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", -100, 600, 100, 100)
$HorizontalBad8=GUICtrlCreatePic(@ScriptDir & "\Bad2.jpg", 1200, 700, 100, 100)
Local $VerticalBad1y=-100
Local $VerticalBad2y=800
Local $VerticalBad3y=-100
Local $VerticalBad4y=800
Local $VerticalBad5y=-100
Local $VerticalBad6y=800
Local $VerticalBad7y=-100
Local $VerticalBad8y=800
Local $VerticalBad9y=-100
Local $VerticalBad10y=800
Local $VerticalBad11y=-100
Local $VerticalBad12y=800
$VerticalBad1=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad2=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad3=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad4=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad5=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad6=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad7=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad8=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad9=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad10=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$VerticalBad11=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, -100, 100, 100)
$VerticalBad12=GUICtrlCreatePic(@ScriptDir & "\Bad1.jpg", 0, 800, 100, 100)
$PointLabel=GUICtrlCreateLabel("", 50, 330, 1150, 300)
GUICtrlSetFont(-1, 35, 0, 0, "Comic Sans MS")
GUICtrlSetState($PointLabel, $GUI_HIDE)
$ContinueLabel=GUICtrlCreateLabel("Click to continue", 100, 700, 300, 50)
GUICtrlSetFont(-1, 20, 0, 0, "Comic Sans MS")
GUICtrlSetState($ContinueLabel, $GUI_HIDE)
$Highscorelabel=GUICtrlCreateLabel("", 50, 0, 1150, 300)
GUICtrlSetFont(-1, 25, 0, 0, "Comic Sans MS")
GUICtrlSetState($Highscorelabel, $GUI_HIDE)
#endregion Stage 0

#region Stage 1
$ResizeBads=0
$ResizeBads2=100
$ResizeBad1x=50
$ResizeBad1y=50
$ResizeBad2x=50
$ResizeBad2y=50
$ResizeBad3x=50
$ResizeBad3y=50
$ResizeBad4x=50
$ResizeBad4y=50
$ResizeBad5x=50
$ResizeBad5y=50
$ResizeBad6x=50
$ResizeBad6y=50
$ResizeBad7x=50
$ResizeBad7y=50
$ResizeBad8x=50
$ResizeBad8y=50
$ResizeBad9x=50
$ResizeBad9y=50
$ResizeBad10x=50
$ResizeBad10y=50
$ResizeBad11x=50
$ResizeBad11y=50
$ResizeBad12x=50
$ResizeBad12y=50
$ResizeBad13x=50
$ResizeBad13y=50
$ResizeBad14x=50
$ResizeBad14y=50
$ResizeBad15x=50
$ResizeBad15y=50
$ResizeBad16x=50
$ResizeBad16y=50
$ResizeBad17x=50
$ResizeBad17y=50
$ResizeBad18x=50
$ResizeBad18y=50
$ResizeBad19x=50
$ResizeBad19y=50
$ResizeBad20x=50
$ResizeBad20y=50
$ResizeBad21x=50
$ResizeBad21y=50
$ResizeBad22x=50
$ResizeBad22y=50
$ResizeBad23x=50
$ResizeBad23y=50
$ResizeBad24x=50
$ResizeBad24y=50
$ResizeBad25x=50
$ResizeBad25y=50
$ResizeBad26x=50
$ResizeBad26y=50
$ResizeBad27x=50
$ResizeBad27y=50
$ResizeBad28x=50
$ResizeBad28y=50
$ResizeBad29x=50
$ResizeBad29y=50
$ResizeBad30x=50
$ResizeBad30y=50
$ResizeBad31x=50
$ResizeBad31y=50
$ResizeBad32x=50
$ResizeBad32y=50
$ResizeBad33x=50
$ResizeBad33y=50
$ResizeBad34x=50
$ResizeBad34y=50
$ResizeBad35x=50
$ResizeBad35y=50
$ResizeBad36x=50
$ResizeBad36y=50
$ResizeBad37x=50
$ResizeBad37y=50
$ResizeBad38x=50
$ResizeBad38y=50
$ResizeBad39x=50
$ResizeBad39y=50
$ResizeBad40x=50
$ResizeBad40y=50
$Random1=0
$Random1b=0
$Random2=0
$Random2b=0
$Random3=0
$Random3b=0
$Random4=0
$Random4b=0
$Random5=0
$Random5b=0
$Random6=0
$Random6b=0
$Random7=0
$Random7b=0
$Random8=0
$Random8b=0
$Random9=0
$Random9b=0
$Random10=0
$Random10b=0
$Random11=0
$Random11b=0
$Random12=0
$Random12b=0
$Random13=0
$Random13b=0
$Random14=0
$Random14b=0
$Random15=0
$Random15b=0
$Random16=0
$Random16b=0
$Random17=0
$Random17b=0
$Random18=0
$Random18b=0
$Random19=0
$Random19b=0
$Random20=0
$Random20b=0
$Random21=0
$Random21b=0
$Random22=0
$Random22b=0
$Random23=0
$Random23b=0
$Random24=0
$Random24b=0
$Random25=0
$Random25b=0
$Random26=0
$Random26b=0
$Random27=0
$Random27b=0
$Random28=0
$Random28b=0
$Random29=0
$Random29b=0
$Random30=0
$Random30b=0
$Random31=0
$Random31b=0
$Random32=0
$Random32b=0
$Random33=0
$Random33b=0
$Random34=0
$Random34b=0
$Random35=0
$Random35b=0
$Random36=0
$Random36b=0
$Random37=0
$Random37b=0
$Random38=0
$Random38b=0
$Random39=0
$Random39b=0
$Random40=0
$Random40b=0
$1=1
$ResizeBad1_Direction=0
$ResizeBad2_Direction=0
$ResizeBad3_Direction=0
$ResizeBad4_Direction=0
$ResizeBad5_Direction=0
$ResizeBad6_Direction=0
$ResizeBad7_Direction=0
$ResizeBad8_Direction=0
$ResizeBad9_Direction=0
$ResizeBad10_Direction=0
$ResizeBad11_Direction=0
$ResizeBad12_Direction=0
$ResizeBad13_Direction=0
$ResizeBad14_Direction=0
$ResizeBad15_Direction=0
$ResizeBad16_Direction=0
$ResizeBad17_Direction=0
$ResizeBad18_Direction=0
$ResizeBad19_Direction=0
$ResizeBad20_Direction=0
$ResizeBad21_Direction=0
$ResizeBad22_Direction=0
$ResizeBad23_Direction=0
$ResizeBad24_Direction=0
$ResizeBad25_Direction=0
$ResizeBad26_Direction=0
$ResizeBad27_Direction=0
$ResizeBad28_Direction=0
$ResizeBad29_Direction=0
$ResizeBad30_Direction=0
$ResizeBad31_Direction=0
$ResizeBad32_Direction=0
$ResizeBad33_Direction=0
$ResizeBad34_Direction=0
$ResizeBad35_Direction=0
$ResizeBad36_Direction=0
$ResizeBad37_Direction=0
$ResizeBad38_Direction=0
$ResizeBad39_Direction=0
$ResizeBad40_Direction=0
$ResizeBad1Active=False
$ResizeBad2Active=False
$ResizeBad3Active=False
$ResizeBad4Active=False
$ResizeBad5Active=False
$ResizeBad6Active=False
$ResizeBad7Active=False
$ResizeBad8Active=False
$ResizeBad9Active=False
$ResizeBad10Active=False
$ResizeBad11Active=False
$ResizeBad12Active=False
$ResizeBad13Active=False
$ResizeBad14Active=False
$ResizeBad15Active=False
$ResizeBad16Active=False
$ResizeBad17Active=False
$ResizeBad18Active=False
$ResizeBad19Active=False
$ResizeBad20Active=False
$ResizeBad21Active=False
$ResizeBad22Active=False
$ResizeBad23Active=False
$ResizeBad24Active=False
$ResizeBad25Active=False
$ResizeBad26Active=False
$ResizeBad27Active=False
$ResizeBad28Active=False
$ResizeBad29Active=False
$ResizeBad30Active=False
$ResizeBad31Active=False
$ResizeBad32Active=False
$ResizeBad33Active=False
$ResizeBad34Active=False
$ResizeBad35Active=False
$ResizeBad36Active=False
$ResizeBad37Active=False
$ResizeBad38Active=False
$ResizeBad39Active=False
$ResizeBad40Active=False
$ResizeBad1=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad2=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad3=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad4=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad5=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad6=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad7=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad8=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad9=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad10=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad11=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad12=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad13=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad14=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad15=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad16=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad17=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad18=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad19=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad20=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad21=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad22=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad23=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad24=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad25=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad26=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad27=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad28=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad29=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad30=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad31=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad32=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad33=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad34=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad35=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad36=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad37=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad38=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad39=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
$ResizeBad40=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", 0, 0, 0, 0)
GUICtrlSetState($ResizeBad1, $GUI_HIDE)
GUICtrlSetState($ResizeBad2, $GUI_HIDE)
GUICtrlSetState($ResizeBad3, $GUI_HIDE)
GUICtrlSetState($ResizeBad4, $GUI_HIDE)
GUICtrlSetState($ResizeBad5, $GUI_HIDE)
GUICtrlSetState($ResizeBad6, $GUI_HIDE)
GUICtrlSetState($ResizeBad7, $GUI_HIDE)
GUICtrlSetState($ResizeBad8, $GUI_HIDE)
GUICtrlSetState($ResizeBad9, $GUI_HIDE)
GUICtrlSetState($ResizeBad10, $GUI_HIDE)
GUICtrlSetState($ResizeBad11, $GUI_HIDE)
GUICtrlSetState($ResizeBad12, $GUI_HIDE)
GUICtrlSetState($ResizeBad13, $GUI_HIDE)
GUICtrlSetState($ResizeBad14, $GUI_HIDE)
GUICtrlSetState($ResizeBad15, $GUI_HIDE)
GUICtrlSetState($ResizeBad16, $GUI_HIDE)
GUICtrlSetState($ResizeBad17, $GUI_HIDE)
GUICtrlSetState($ResizeBad18, $GUI_HIDE)
GUICtrlSetState($ResizeBad19, $GUI_HIDE)
GUICtrlSetState($ResizeBad20, $GUI_HIDE)
GUICtrlSetState($ResizeBad21, $GUI_HIDE)
GUICtrlSetState($ResizeBad22, $GUI_HIDE)
GUICtrlSetState($ResizeBad23, $GUI_HIDE)
GUICtrlSetState($ResizeBad24, $GUI_HIDE)
GUICtrlSetState($ResizeBad25, $GUI_HIDE)
GUICtrlSetState($ResizeBad26, $GUI_HIDE)
GUICtrlSetState($ResizeBad27, $GUI_HIDE)
GUICtrlSetState($ResizeBad28, $GUI_HIDE)
GUICtrlSetState($ResizeBad29, $GUI_HIDE)
GUICtrlSetState($ResizeBad30, $GUI_HIDE)
GUICtrlSetState($ResizeBad31, $GUI_HIDE)
GUICtrlSetState($ResizeBad32, $GUI_HIDE)
GUICtrlSetState($ResizeBad33, $GUI_HIDE)
GUICtrlSetState($ResizeBad34, $GUI_HIDE)
GUICtrlSetState($ResizeBad35, $GUI_HIDE)
GUICtrlSetState($ResizeBad36, $GUI_HIDE)
GUICtrlSetState($ResizeBad37, $GUI_HIDE)
GUICtrlSetState($ResizeBad38, $GUI_HIDE)
GUICtrlSetState($ResizeBad39, $GUI_HIDE)
GUICtrlSetState($ResizeBad40, $GUI_HIDE)
#endregion Stage 1

#region Stage 2
    Local $Random
    Local $CurrentlyYellowx, $CurrentlyYellowy
    Local $CurrentlyOpenx1, $CurrentlyOpeny1, $CurrentlyOpenx2, $CurrentlyOpeny2
    Local $Posx2, $Posy2, $Posx, $Posy
    Local $Stage2Timer
    Local $Stage2Goal
    Local $Stage2HOF
    $FirstStage2Timer=True
    $FirstStage2=True
    $Stage2Count=0
    $Stage2Status=0
    $Stage2button1=GUICtrlCreateButton("Sprint - 30", 0, 0, 400, 800)
    GUICtrlSetFont(-1, 25, 0, 0, "Comic Sans MS")
    $Stage2button2=GUICtrlCreateButton("Normal - 100", 400, 0, 400, 800)
    GUICtrlSetFont(-1, 25, 0, 0, "Comic Sans MS")
    $Stage2button3=GUICtrlCreateButton("Intolerable - 500", 800, 0, 400, 800)
    GUICtrlSetFont(-1, 25, 0, 0, "Comic Sans MS")
    GUICtrlSetState($Stage2button1, $GUI_HIDE)
    GUICtrlSetState($Stage2button2, $GUI_HIDE)
    GUICtrlSetState($Stage2button3, $GUI_HIDE)
    Dim $FloorBlack[12][8]
    Dim $FloorYellow[12][8]
    $Floory=0
    $Floorx=0
    For $3=0 To 11

        For $2=0 To 7
            $FloorYellow[$3][$2]=GUICtrlCreatePic(@ScriptDir & "\Bad4.jpg", $Floorx, $Floory, 100, 100)
            $FloorBlack[$3][$2]=GUICtrlCreatePic(@ScriptDir & "\Bad3.jpg", $Floorx, $Floory, 100, 100)
            GUICtrlSetState($FloorYellow[$3][$2], $GUI_HIDE)
            GUICtrlSetState($FloorBlack[$3][$2], $GUI_HIDE)
            $Floory+=100
        Next
        $Floorx+=100
        $Floory=0
    Next

#endregion

$Stage0=GUICtrlCreateButton("Stage 0", 0, 0, 400, 800)
GUICtrlSetFont(-1, 60, 0, 0, "Comic Sans MS")
$Stage1=GUICtrlCreateButton("Stage 1", 400, 0, 400, 800)
GUICtrlSetFont(-1, 60, 0, 0, "Comic Sans MS")
$Stage2=GUICtrlCreateButton("Stage 2", 800, 0, 400, 800)
GUICtrlSetFont(-1, 60, 0, 0, "Comic Sans MS")

GUISetState()
GameMenu()


While 1
    $MousePos=GUIGetCursorInfo($Gui)
    If $CurrentState=0 Then
        If $MousePos[0]<0 or $MousePos[1]<0 or $MousePos[0]>1200 or $MousePos[1]>800 Then Restartgame0()
        If $MousePos[4]<>0 and TimerDiff($Timer)>100 Then Restartgame0()
    EndIf
    If $CurrentState=1 Then
        If $MousePos[0]<0 or $MousePos[1]<0 or $MousePos[0]>1200 or $MousePos[1]>800 Then Restartgame1()
        If $MousePos[4]<>0 and TimerDiff($Timer)>100 Then Restartgame1()
    EndIf
    If $CurrentState=2 Then
        If $MousePos[0]<0 or $MousePos[1]<0 or $MousePos[0]>1200 or $MousePos[1]>800 Then Restartgame2()
        If $MousePos[4]<>0 and TimerDiff($Timer)>100 Then Restartgame2()
    EndIf
    $msg=GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    Switch $CurrentState
        Case 0
            Case0()
        Case 1
            Case1()
        Case 2
            Case2()
    EndSwitch
WEnd

Func StartState2()
    GUICtrlSetState($Stage0, $GUI_HIDE)
    GUICtrlSetState($Stage1, $GUI_HIDE)
    GUICtrlSetState($Stage2, $GUI_HIDE)
    GUICtrlSetState($Stage2button1, $GUI_SHOW)
    GUICtrlSetState($Stage2button2, $GUI_SHOW)
    GUICtrlSetState($Stage2button3, $GUI_SHOW)
    While 1
        $msg=GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Stage2button1
                $Stage2Goal=30
                $Stage2HOF=1
                ExitLoop
            Case $Stage2button2
                $Stage2Goal=100
                $Stage2HOF=2
                ExitLoop
            Case $Stage2button3
                $Stage2Goal=500
                $Stage2HOF=3
                ExitLoop
        EndSwitch
    WEnd
    GUICtrlSetState($Stage2button1, $GUI_HIDE)
    GUICtrlSetState($Stage2button2, $GUI_HIDE)
    GUICtrlSetState($Stage2button3, $GUI_HIDE)

    For $3=0 To 11
        For $2=0 To 7
            GUICtrlSetState($FloorBlack[$3][$2], $GUI_SHOW)
            GUICtrlSetState($FloorYellow[$3][$2], $GUI_SHOW)
        Next
    Next
    $Stage2Status=0
    $Stage2Count=0
    $FirstStage2=True
    $FirstStage2Timer=True
    $Timer=TimerInit()
EndFunc

Func Restartgame2()

    $FinalTime=TimerDiff($Timer)
    For $3=0 To 11
        For $2=0 To 7
            GUICtrlSetState($FloorBlack[$3][$2], $GUI_HIDE)
            GUICtrlSetState($FloorYellow[$3][$2], $GUI_HIDE)
        Next
    Next
    GUICtrlSetData($PointLabel, "Score: " & $Stage2Count & " moves in " & $FinalTime & " milliseconds")
;~  If $Stage2Status=1 Then
;~      $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Score", "99999999")
;~      $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Score", "99999999")
;~      $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Score", "99999999")
;~      $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Name", "")
;~      $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Name", "")
;~      $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Name", "")
;~      If $ReadIni1<>"0" Then
;~          If $ReadIni1>$FinalTime Then
;~              $Name=InputBox("New High Score!", "What's your name?")
;~              If Not @error=1 Then
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Score", $FinalTime)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Name", $Name)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Score", $ReadIni1)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Name", $ReadIni1Name)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Score", $ReadIni2)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Name", $ReadIni2Name)
;~              EndIf
;~          ElseIf $ReadIni2>$FinalTime Then
;~              $Name=InputBox("Second Place!", "What's your name?")
;~              If Not @error=1 Then
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Score", $FinalTime)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Name", $Name)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Score", $ReadIni2)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Name", $ReadIni2Name)
;~              EndIf
;~          ElseIf $ReadIni3>$FinalTime Then
;~              $Name=InputBox("Third Place!", "What's your name?")
;~              If Not @error=1 Then
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Score", $FinalTime)
;~                  IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Name", $Name)
;~              EndIf
;~          EndIf
;~      Else
;~          $Name=InputBox("New High Score!", "What's your name?")
;~          If Not @error=1 Then
;~              IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Score", $FinalTime)
;~              IniWrite(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Name", $Name)
;~          EndIf
;~      EndIf
;~  EndIf
;~  $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Score", "99999999")
;~  $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 1st", "Name", "")
;~  $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Score", "99999999")
;~  $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 2nd", "Name", "")
;~  $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Score", "99999999")
;~  $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 2-" & $Stage2HOF & " 3rd", "Name", "")
;~  GUICtrlSetData($Highscorelabel, $ReadIni1Name & ": " & $ReadIni1 & @CRLF & $ReadIni2Name & ": " & $ReadIni2 & @CRLF & $ReadIni3Name & ": " & $ReadIni3)
;~  GUICtrlSetState($PointLabel, $GUI_SHOW)
;~  GUICtrlSetState($Highscorelabel, $GUI_SHOW)
;~  GUICtrlSetState($ContinueLabel, $GUI_SHOW)
    While 1
        $msg=GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
        If _IsPressed(01) Then
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]<800 and $MousePos[1]>0 and $MousePos[0]>0 and $MousePos[0]<1200 Then ExitLoop
        EndIf
    WEnd
    While _IsPressed(01)
    WEnd
    GUICtrlSetState($PointLabel, $GUI_HIDE)
    GUICtrlSetState($ContinueLabel, $GUI_HIDE)
    GUICtrlSetState($Highscorelabel, $GUI_HIDE)
    $Stage2Count=0
    GameMenu()
EndFunc

Func Case2()
    If $FirstStage2=True Then
        While 1
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[0]>0 And $MousePos[0]<100 Then $Posx=0
            If $MousePos[0]>100 And $MousePos[0]<200 Then $Posx=1
            If $MousePos[0]>200 And $MousePos[0]<300 Then $Posx=2
            If $MousePos[0]>300 And $MousePos[0]<400 Then $Posx=3
            If $MousePos[0]>400 And $MousePos[0]<500 Then $Posx=4
            If $MousePos[0]>500 And $MousePos[0]<600 Then $Posx=5
            If $MousePos[0]>600 And $MousePos[0]<700 Then $Posx=6
            If $MousePos[0]>700 And $MousePos[0]<800 Then $Posx=7
            If $MousePos[0]>800 And $MousePos[0]<900 Then $Posx=8
            If $MousePos[0]>900 And $MousePos[0]<1000 Then $Posx=9
            If $MousePos[0]>1000 And $MousePos[0]<1100 Then $Posx=10
            If $MousePos[0]>1100 And $MousePos[0]<1200 Then $Posx=11
            If $MousePos[0]=0 Or $MousePos[0]=100 Or $MousePos[0]=200 Or $MousePos[0]=300 Or $MousePos[0]=400 Or $MousePos[0]=500 Or $MousePos[0]=600 Or $MousePos[0]=700 Or $MousePos[0]=800 Or $MousePos[0]=900 Or $MousePos[0]=1000 Or $MousePos[0]=11000 Or $MousePos[0]=12000 Then
            Else
                ExitLoop
            EndIf
        WEnd
        While 1
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]>0 And $MousePos[1]<100 Then $Posy=0
            If $MousePos[1]>100 And $MousePos[1]<200 Then $Posy=1
            If $MousePos[1]>200 And $MousePos[1]<300 Then $Posy=2
            If $MousePos[1]>300 And $MousePos[1]<400 Then $Posy=3
            If $MousePos[1]>400 And $MousePos[1]<500 Then $Posy=4
            If $MousePos[1]>500 And $MousePos[1]<600 Then $Posy=5
            If $MousePos[1]>600 And $MousePos[1]<700 Then $Posy=6
            If $MousePos[1]>700 And $MousePos[1]<800 Then $Posy=7
            If $MousePos[1]=0 Or $MousePos[1]=100 Or $MousePos[1]=200 Or $MousePos[1]=300 Or $MousePos[1]=400 Or $MousePos[1]=500 Or $MousePos[1]=600 Or $MousePos[1]=700 Or $MousePos[1]=800 Then
            Else
                ExitLoop
            EndIf
        WEnd
        GUICtrlSetState($FloorBlack[$Posx][$Posy], $GUI_HIDE)
        GUICtrlSetState($FloorYellow[$Posx][$Posy], $GUI_HIDE)
        $FirstStage2=False
        $CurrentlyOpenx1=$Posx
        $CurrentlyOpeny1=$Posy
        While 1
            $Random=Random(1, 4, 1)
            If $Random=1 And $Posx<>0 Then
                $Posx-=1
                If $Posx=$CurrentlyOpenx2 Then
                    $Posx+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=2 And $Posy<>0 Then
                $Posy-=1
                If $Posy=$CurrentlyOpeny2 Then
                    $Posy+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=3 And $Posx<>11 Then
                $Posx+=1
                If $Posx=$CurrentlyOpenx2 Then
                    $Posx-=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=4 And $Posy<>7 Then
                $Posy+=1
                If $Posy=$CurrentlyOpeny2 Then
                    $Posy-=1
                Else
                    ExitLoop
                EndIf
            EndIf
        WEnd
        If $Posx>11 Then $Posx=11
        If $Posy>7 Then $Posy=7

        GUICtrlSetState($FloorBlack[$Posx][$Posy],$GUI_HIDE)
        GUICtrlSetState($FloorYellow[$Posx][$Posy], $GUI_HIDE)
        $CurrentlyOpenx2=$Posx
        $CurrentlyOpeny2=$Posy

        While 1
            $Random=Random(1, 4, 1)
            If $Random=1 And $Posx<>0 Then
                $Posx-=1
                If $Posx=$CurrentlyOpenx1 Then
                    $Posx+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=2 And $Posy<>0 Then
                $Posy-=1
                If $Posy=$CurrentlyOpeny1 Then
                    $Posy+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=3 And $Posx<>11 Then
                $Posx+=1
                If $Posx=$CurrentlyOpenx1 Then
                    $Posx-=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=4 And $Posy<>7 Then
                $Posy+=1
                If $Posy=$CurrentlyOpeny1 Then
                    $Posy-=1
                Else
                    ExitLoop
                EndIf
            EndIf
        WEnd
        If $Posx>11 Then $Posx=11
        If $Posy>7 Then $Posy=7

        GUICtrlSetState($FloorBlack[$Posx][$Posy],$GUI_HIDE)
        $CurrentlyYellowx=$Posx
        $CurrentlyYellowy=$Posy
    EndIf

    If $MousePos[0]>0 And $MousePos[0]<100 Then $Posx2=0
    If $MousePos[0]>100 And $MousePos[0]<200 Then $Posx2=1
    If $MousePos[0]>200 And $MousePos[0]<300 Then $Posx2=2
    If $MousePos[0]>300 And $MousePos[0]<400 Then $Posx2=3
    If $MousePos[0]>400 And $MousePos[0]<500 Then $Posx2=4
    If $MousePos[0]>500 And $MousePos[0]<600 Then $Posx2=5
    If $MousePos[0]>600 And $MousePos[0]<700 Then $Posx2=6
    If $MousePos[0]>700 And $MousePos[0]<800 Then $Posx2=7
    If $MousePos[0]>800 And $MousePos[0]<900 Then $Posx2=8
    If $MousePos[0]>900 And $MousePos[0]<1000 Then $Posx2=9
    If $MousePos[0]>1000 And $MousePos[0]<1100 Then $Posx2=10
    If $MousePos[0]>1100 And $MousePos[0]<1200 Then $Posx2=11
    If $MousePos[1]>0 And $MousePos[1]<100 Then $Posy2=0
    If $MousePos[1]>100 And $MousePos[1]<200 Then $Posy2=1
    If $MousePos[1]>200 And $MousePos[1]<300 Then $Posy2=2
    If $MousePos[1]>300 And $MousePos[1]<400 Then $Posy2=3
    If $MousePos[1]>400 And $MousePos[1]<500 Then $Posy2=4
    If $MousePos[1]>500 And $MousePos[1]<600 Then $Posy2=5
    If $MousePos[1]>600 And $MousePos[1]<700 Then $Posy2=6
    If $MousePos[1]>700 And $MousePos[1]<800 Then $Posy2=7



    If $Posx2<>$CurrentlyOpenx1 Or $Posy2<>$CurrentlyOpeny1 Then
        If $FirstStage2Timer=True Then
            $Timer=TimerInit()
            $FirstStage2Timer=False
        EndIf
        GUICtrlSetState($FloorYellow[$CurrentlyOpenx1][$CurrentlyOpeny1], $GUI_SHOW)
        GUICtrlSetState($FloorBlack[$CurrentlyOpenx1][$CurrentlyOpeny1], $GUI_SHOW)
        GUICtrlSetState($FloorYellow[$CurrentlyYellowx][$CurrentlyYellowy], $GUI_HIDE)
        While 1
            $Random=Random(1, 4, 1)
            If $Random=1 And $Posx<>0 Then
                $Posx-=1
                If $Posx=$CurrentlyOpenx2 Then
                    $Posx+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=2 And $Posy<>0 Then
                $Posy-=1
                If $Posy=$CurrentlyOpeny2 Then
                    $Posy+=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=3 And $Posx<>11 Then
                $Posx+=1
                If $Posx=$CurrentlyOpenx2 Then
                    $Posx-=1
                Else
                    ExitLoop
                EndIf
            ElseIf $Random=4 And $Posy<>7 Then
                $Posy+=1
                If $Posy=$CurrentlyOpeny2 Then
                    $Posy-=1
                Else
                    ExitLoop
                EndIf
            EndIf
        WEnd
        If $Posx>11 Then $Posx=11
        If $Posy>7 Then $Posy=7
        GUICtrlSetState($FloorBlack[$Posx][$Posy],$GUI_HIDE)

        $CurrentlyOpenx1=$CurrentlyOpenx2
        $CurrentlyOpeny1=$CurrentlyOpeny2
        $CurrentlyOpenx2=$CurrentlyYellowx
        $CurrentlyOpeny2=$CurrentlyYellowy
        $CurrentlyYellowx=$Posx
        $CurrentlyYellowy=$Posy
        $Stage2Count+=1
        $Stage2Status=0
        If $Stage2Count>=$Stage2Goal Then
            $Stage2Status=1
            Restartgame2()
        EndIf
    EndIf

EndFunc

Func StartState1()
    $ResizeBads=0
    $ResizeBads2=100
    $1=1
    $ResizeBad1_Direction=0
    $ResizeBad2_Direction=0
    $ResizeBad3_Direction=0
    $ResizeBad4_Direction=0
    $ResizeBad5_Direction=0
    $ResizeBad6_Direction=0
    $ResizeBad7_Direction=0
    $ResizeBad8_Direction=0
    $ResizeBad9_Direction=0
    $ResizeBad10_Direction=0
    $ResizeBad11_Direction=0
    $ResizeBad12_Direction=0
    $ResizeBad13_Direction=0
    $ResizeBad14_Direction=0
    $ResizeBad15_Direction=0
    $ResizeBad16_Direction=0
    $ResizeBad17_Direction=0
    $ResizeBad18_Direction=0
    $ResizeBad19_Direction=0
    $ResizeBad20_Direction=0
    $ResizeBad21_Direction=0
    $ResizeBad22_Direction=0
    $ResizeBad23_Direction=0
    $ResizeBad24_Direction=0
    $ResizeBad25_Direction=0
    $ResizeBad26_Direction=0
    $ResizeBad27_Direction=0
    $ResizeBad28_Direction=0
    $ResizeBad29_Direction=0
    $ResizeBad30_Direction=0
    $ResizeBad31_Direction=0
    $ResizeBad32_Direction=0
    $ResizeBad33_Direction=0
    $ResizeBad34_Direction=0
    $ResizeBad35_Direction=0
    $ResizeBad36_Direction=0
    $ResizeBad37_Direction=0
    $ResizeBad38_Direction=0
    $ResizeBad39_Direction=0
    $ResizeBad40_Direction=0
    $ResizeBad1x=1
    $ResizeBad1y=1
    $ResizeBad2x=1
    $ResizeBad2y=1
    $ResizeBad3x=1
    $ResizeBad3y=1
    $ResizeBad4x=1
    $ResizeBad4y=1
    $ResizeBad5x=1
    $ResizeBad5y=1
    $ResizeBad6x=1
    $ResizeBad6y=1
    $ResizeBad7x=1
    $ResizeBad7y=1
    $ResizeBad8x=1
    $ResizeBad8y=1
    $ResizeBad9x=1
    $ResizeBad9y=1
    $ResizeBad10x=1
    $ResizeBad10y=1
    $ResizeBad11x=1
    $ResizeBad11y=1
    $ResizeBad12x=1
    $ResizeBad12y=1
    $ResizeBad13x=1
    $ResizeBad13y=1
    $ResizeBad14x=1
    $ResizeBad14y=1
    $ResizeBad15x=1
    $ResizeBad15y=1
    $ResizeBad16x=1
    $ResizeBad16y=1
    $ResizeBad17x=1
    $ResizeBad17y=1
    $ResizeBad18x=1
    $ResizeBad18y=1
    $ResizeBad19x=1
    $ResizeBad19y=1
    $ResizeBad20x=1
    $ResizeBad20y=1
    $ResizeBad21x=1
    $ResizeBad21y=1
    $ResizeBad22x=1
    $ResizeBad22y=1
    $ResizeBad23x=1
    $ResizeBad23y=1
    $ResizeBad24x=1
    $ResizeBad24y=1
    $ResizeBad25x=1
    $ResizeBad25y=1
    $ResizeBad26x=1
    $ResizeBad26y=1
    $ResizeBad27x=1
    $ResizeBad27y=1
    $ResizeBad28x=1
    $ResizeBad28y=1
    $ResizeBad29x=1
    $ResizeBad29y=1
    $ResizeBad30x=1
    $ResizeBad30y=1
    $ResizeBad31x=1
    $ResizeBad31y=1
    $ResizeBad32x=1
    $ResizeBad32y=1
    $ResizeBad33x=1
    $ResizeBad33y=1
    $ResizeBad34x=1
    $ResizeBad34y=1
    $ResizeBad35x=1
    $ResizeBad35y=1
    $ResizeBad36x=1
    $ResizeBad36y=1
    $ResizeBad37x=1
    $ResizeBad37y=1
    $ResizeBad38x=1
    $ResizeBad38y=1
    $ResizeBad39x=1
    $ResizeBad39y=1
    $ResizeBad40x=1
    $ResizeBad40y=1
    $Timer=TimerInit()
    GUICtrlSetState($ResizeBad1, $GUI_SHOW)
EndFunc

Func Restartgame1()
    $ResizeBad1_Direction=0
    $ResizeBad2_Direction=0
    $ResizeBad3_Direction=0
    $ResizeBad4_Direction=0
    $ResizeBad5_Direction=0
    $ResizeBad6_Direction=0
    $ResizeBad7_Direction=0
    $ResizeBad8_Direction=0
    $ResizeBad9_Direction=0
    $ResizeBad10_Direction=0
    $ResizeBad11_Direction=0
    $ResizeBad12_Direction=0
    $ResizeBad13_Direction=0
    $ResizeBad14_Direction=0
    $ResizeBad15_Direction=0
    $ResizeBad16_Direction=0
    $ResizeBad17_Direction=0
    $ResizeBad18_Direction=0
    $ResizeBad19_Direction=0
    $ResizeBad20_Direction=0
    $ResizeBad21_Direction=0
    $ResizeBad22_Direction=0
    $ResizeBad23_Direction=0
    $ResizeBad24_Direction=0
    $ResizeBad25_Direction=0
    $ResizeBad26_Direction=0
    $ResizeBad27_Direction=0
    $ResizeBad28_Direction=0
    $ResizeBad29_Direction=0
    $ResizeBad30_Direction=0
    $ResizeBad31_Direction=0
    $ResizeBad32_Direction=0
    $ResizeBad33_Direction=0
    $ResizeBad34_Direction=0
    $ResizeBad35_Direction=0
    $ResizeBad36_Direction=0
    $ResizeBad37_Direction=0
    $ResizeBad38_Direction=0
    $ResizeBad39_Direction=0
    $ResizeBad40_Direction=0
    $ResizeBad1Active=False
    $ResizeBad2Active=False
    $ResizeBad3Active=False
    $ResizeBad4Active=False
    $ResizeBad5Active=False
    $ResizeBad6Active=False
    $ResizeBad7Active=False
    $ResizeBad8Active=False
    $ResizeBad9Active=False
    $ResizeBad10Active=False
    $ResizeBad11Active=False
    $ResizeBad12Active=False
    $ResizeBad13Active=False
    $ResizeBad14Active=False
    $ResizeBad15Active=False
    $ResizeBad16Active=False
    $ResizeBad17Active=False
    $ResizeBad18Active=False
    $ResizeBad19Active=False
    $ResizeBad20Active=False
    $ResizeBad21Active=False
    $ResizeBad22Active=False
    $ResizeBad23Active=False
    $ResizeBad24Active=False
    $ResizeBad25Active=False
    $ResizeBad26Active=False
    $ResizeBad27Active=False
    $ResizeBad28Active=False
    $ResizeBad29Active=False
    $ResizeBad30Active=False
    $ResizeBad31Active=False
    $ResizeBad32Active=False
    $ResizeBad33Active=False
    $ResizeBad34Active=False
    $ResizeBad35Active=False
    $ResizeBad36Active=False
    $ResizeBad37Active=False
    $ResizeBad38Active=False
    $ResizeBad39Active=False
    $ResizeBad40Active=False
    GUICtrlSetState($ResizeBad1, $GUI_HIDE)
    GUICtrlSetState($ResizeBad2, $GUI_HIDE)
    GUICtrlSetState($ResizeBad3, $GUI_HIDE)
    GUICtrlSetState($ResizeBad4, $GUI_HIDE)
    GUICtrlSetState($ResizeBad5, $GUI_HIDE)
    GUICtrlSetState($ResizeBad6, $GUI_HIDE)
    GUICtrlSetState($ResizeBad7, $GUI_HIDE)
    GUICtrlSetState($ResizeBad8, $GUI_HIDE)
    GUICtrlSetState($ResizeBad9, $GUI_HIDE)
    GUICtrlSetState($ResizeBad10, $GUI_HIDE)
    GUICtrlSetState($ResizeBad11, $GUI_HIDE)
    GUICtrlSetState($ResizeBad12, $GUI_HIDE)
    GUICtrlSetState($ResizeBad13, $GUI_HIDE)
    GUICtrlSetState($ResizeBad14, $GUI_HIDE)
    GUICtrlSetState($ResizeBad15, $GUI_HIDE)
    GUICtrlSetState($ResizeBad16, $GUI_HIDE)
    GUICtrlSetState($ResizeBad17, $GUI_HIDE)
    GUICtrlSetState($ResizeBad18, $GUI_HIDE)
    GUICtrlSetState($ResizeBad19, $GUI_HIDE)
    GUICtrlSetState($ResizeBad20, $GUI_HIDE)
    GUICtrlSetState($ResizeBad21, $GUI_HIDE)
    GUICtrlSetState($ResizeBad22, $GUI_HIDE)
    GUICtrlSetState($ResizeBad23, $GUI_HIDE)
    GUICtrlSetState($ResizeBad24, $GUI_HIDE)
    GUICtrlSetState($ResizeBad25, $GUI_HIDE)
    GUICtrlSetState($ResizeBad26, $GUI_HIDE)
    GUICtrlSetState($ResizeBad27, $GUI_HIDE)
    GUICtrlSetState($ResizeBad28, $GUI_HIDE)
    GUICtrlSetState($ResizeBad29, $GUI_HIDE)
    GUICtrlSetState($ResizeBad30, $GUI_HIDE)
    GUICtrlSetState($ResizeBad31, $GUI_HIDE)
    GUICtrlSetState($ResizeBad32, $GUI_HIDE)
    GUICtrlSetState($ResizeBad33, $GUI_HIDE)
    GUICtrlSetState($ResizeBad34, $GUI_HIDE)
    GUICtrlSetState($ResizeBad35, $GUI_HIDE)
    GUICtrlSetState($ResizeBad36, $GUI_HIDE)
    GUICtrlSetState($ResizeBad37, $GUI_HIDE)
    GUICtrlSetState($ResizeBad38, $GUI_HIDE)
    GUICtrlSetState($ResizeBad39, $GUI_HIDE)
    GUICtrlSetState($ResizeBad40, $GUI_HIDE)

    Local $ReadIni1=""
    Local $ReadIni2=""
    Local $ReadIni3=""
    $FinalTime=TimerDiff($Timer)

    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 1 1st", "Score", "0")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Score", "0")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Score", "0")
    $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 1st", "Name", "")
    $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Name", "")
    $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Name", "")
    GUICtrlSetData($PointLabel, "Score: " & $FinalTime & " milliseconds")
    If $ReadIni1<>"0" Then

        If $ReadIni1<$FinalTime Then
            $Name=InputBox("New High Score!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 1st", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 1st", "Name", $Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Score", $ReadIni1)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Name", $ReadIni1Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Score", $ReadIni2)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Name", $ReadIni2Name)
            EndIf
        ElseIf $ReadIni2<$FinalTime Then
            $Name=InputBox("Second Place!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Name", $Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Score", $ReadIni2)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Name", $ReadIni2Name)
            EndIf
        ElseIf $ReadIni3<$FinalTime Then
            $Name=InputBox("Third Place!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Name", $Name)
            EndIf
        EndIf
    Else
        $Name=InputBox("New High Score!", "What's your name?")
        If Not @error=1 Then
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1 1st", "Score", $FinalTime)
            IniWrite(@ScriptDir & "\Score.ini", "Stage 1 1st", "Name", $Name)
        EndIf
    EndIf
    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 1 1st", "Score", "0")
    $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 1st", "Name", "")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Score", "0")
    $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 2nd", "Name", "")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Score", "0")
    $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 1 3rd", "Name", "")
    GUICtrlSetData($Highscorelabel, $ReadIni1Name & ": " & $ReadIni1 & @CRLF & $ReadIni2Name & ": " & $ReadIni2 & @CRLF & $ReadIni3Name & ": " & $ReadIni3)
    GUICtrlSetState($PointLabel, $GUI_SHOW)
    GUICtrlSetState($Highscorelabel, $GUI_SHOW)
    GUICtrlSetState($ContinueLabel, $GUI_SHOW)
    While 1
        $msg=GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
        If _IsPressed(01) Then
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]<800 and $MousePos[1]>0 and $MousePos[0]>0 and $MousePos[0]<1200 Then ExitLoop
        EndIf
    WEnd
    While _IsPressed(01)
    WEnd
    GUICtrlSetState($PointLabel, $GUI_HIDE)
    GUICtrlSetState($ContinueLabel, $GUI_HIDE)
    GUICtrlSetState($Highscorelabel, $GUI_HIDE)
    GameMenu()

EndFunc

Func Case1()
    Sleep(1)
    If TimerDiff($Timer)>41000 Then

    ElseIf TimerDiff($Timer)>40000 Then
        $ResizeBad40Active=True
        $ResizeBad40x=1
        $ResizeBad40y=1
        GUICtrlSetState($ResizeBad40, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>39000 Then
        $ResizeBad39Active=True
        $ResizeBad39x=1
        $ResizeBad39y=1
        GUICtrlSetState($ResizeBad39, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>38000 Then
        $ResizeBad38Active=True
        $ResizeBad38x=1
        $ResizeBad38y=1
        GUICtrlSetState($ResizeBad38, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>37000 Then
        $ResizeBad37Active=True
        $ResizeBad37x=1
        $ResizeBad37y=1
        GUICtrlSetState($ResizeBad37, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>36000 Then
        $ResizeBad36Active=True
        $ResizeBad36x=1
        $ResizeBad36y=1
        GUICtrlSetState($ResizeBad36, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>35000 Then
        $ResizeBad35Active=True
        $ResizeBad35x=1
        $ResizeBad35y=1
        GUICtrlSetState($ResizeBad35, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>34000 Then
        $ResizeBad34Active=True
        $ResizeBad34x=1
        $ResizeBad34y=1
        GUICtrlSetState($ResizeBad34, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>33000 Then
        $ResizeBad33Active=True
        $ResizeBad33x=1
        $ResizeBad33y=1
        GUICtrlSetState($ResizeBad33, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>32000 Then
        $ResizeBad32Active=True
        $ResizeBad32x=1
        $ResizeBad32y=1
        GUICtrlSetState($ResizeBad32, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>31000 Then
        $ResizeBad31Active=True
        $ResizeBad31x=1
        $ResizeBad31y=1
        GUICtrlSetState($ResizeBad31, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>30000 Then
        $ResizeBad30Active=True
        $ResizeBad30x=1
        $ResizeBad30y=1
        GUICtrlSetState($ResizeBad30, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>29000 Then
        $ResizeBad29Active=True
        $ResizeBad29x=1
        $ResizeBad29y=1
        GUICtrlSetState($ResizeBad29, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>28000 Then
        $ResizeBad28Active=True
        $ResizeBad28x=1
        $ResizeBad28y=1
        GUICtrlSetState($ResizeBad28, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>27000 Then
        $ResizeBad27Active=True
        $ResizeBad27x=1
        $ResizeBad27y=1
        GUICtrlSetState($ResizeBad27, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>26000 Then
        $ResizeBad26Active=True
        $ResizeBad26x=1
        $ResizeBad26y=1
        GUICtrlSetState($ResizeBad26, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>25000 Then
        $ResizeBad25Active=True
        $ResizeBad25x=1
        $ResizeBad25y=1
        GUICtrlSetState($ResizeBad25, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>24000 Then
        $ResizeBad24Active=True
        $ResizeBad24x=1
        $ResizeBad24y=1
        GUICtrlSetState($ResizeBad24, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>23000 Then
        $ResizeBad23Active=True
        $ResizeBad23x=1
        $ResizeBad23y=1
        GUICtrlSetState($ResizeBad23, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>22000 Then
        $ResizeBad22Active=True
        $ResizeBad22x=1
        $ResizeBad22y=1
        GUICtrlSetState($ResizeBad22, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>21000 Then
        $ResizeBad21Active=True
        $ResizeBad21x=1
        $ResizeBad21y=1
        GUICtrlSetState($ResizeBad21, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>20000 Then
        $ResizeBad20Active=True
        $ResizeBad20x=1
        $ResizeBad20y=1
        GUICtrlSetState($ResizeBad20, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>19000 Then
        $ResizeBad19Active=True
        $ResizeBad19x=1
        $ResizeBad19y=1
        GUICtrlSetState($ResizeBad19, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>18000 Then
        $ResizeBad18Active=True
        $ResizeBad18x=1
        $ResizeBad18y=1
        GUICtrlSetState($ResizeBad18, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>17000 Then
        $ResizeBad17Active=True
        $ResizeBad17x=1
        $ResizeBad17y=1
        GUICtrlSetState($ResizeBad17, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>16000 Then
        $ResizeBad16Active=True
        $ResizeBad16x=1
        $ResizeBad16y=1
        GUICtrlSetState($ResizeBad16, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>15000 Then
        $ResizeBad15Active=True
        $ResizeBad15x=1
        $ResizeBad15y=1
        GUICtrlSetState($ResizeBad15, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>14000 Then
        $ResizeBad14Active=True
        $ResizeBad14x=1
        $ResizeBad14y=1
        GUICtrlSetState($ResizeBad14, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>13000 Then
        $ResizeBad13Active=True
        $ResizeBad13x=1
        $ResizeBad13y=1
        GUICtrlSetState($ResizeBad13, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>12000 Then
        $ResizeBad12Active=True
        $ResizeBad12x=1
        $ResizeBad12y=1
        GUICtrlSetState($ResizeBad12, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>11000 Then
        $ResizeBad11Active=True
        $ResizeBad11x=1
        $ResizeBad11y=1
        GUICtrlSetState($ResizeBad11, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>10000 Then
        $ResizeBad10Active=True
        $ResizeBad10x=1
        $ResizeBad10y=1
        GUICtrlSetState($ResizeBad10, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>9000 Then
        $ResizeBad9Active=True
        $ResizeBad9x=1
        $ResizeBad9y=1
        GUICtrlSetState($ResizeBad9, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>8000 Then
        $ResizeBad8Active=True
        $ResizeBad8x=1
        $ResizeBad8y=1
        GUICtrlSetState($ResizeBad8, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>7000 Then
        $ResizeBad7Active=True
        $ResizeBad7x=1
        $ResizeBad7y=1
        GUICtrlSetState($ResizeBad7, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>6000 Then
        $ResizeBad6Active=True
        $ResizeBad6x=1
        $ResizeBad6y=1
        GUICtrlSetState($ResizeBad6, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>5000 Then
        $ResizeBad5Active=True
        $ResizeBad5x=1
        $ResizeBad5y=1
        GUICtrlSetState($ResizeBad5, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>4000 Then
        $ResizeBad4Active=True
        $ResizeBad4x=1
        $ResizeBad4y=1
        GUICtrlSetState($ResizeBad4, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>3000 Then
        $ResizeBad3Active=True
        $ResizeBad3x=1
        $ResizeBad3y=1
        GUICtrlSetState($ResizeBad3, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>2000 Then
        $ResizeBad2Active=True
        $ResizeBad2x=1
        $ResizeBad2y=1
        GUICtrlSetState($ResizeBad2, $GUI_SHOW)
    ElseIf TimerDiff($Timer)>1000 Then
        $ResizeBad1Active=True
        GUICtrlSetState($ResizeBad1, $GUI_SHOW)
    EndIf








    $1+=1

    If $ResizeBad1Active=True Then $ResizeBad1_Direction+=1
    If $ResizeBad2Active=True Then $ResizeBad2_Direction+=1
    If $ResizeBad3Active=True Then $ResizeBad3_Direction+=1
    If $ResizeBad4Active=True Then $ResizeBad4_Direction+=1
    If $ResizeBad5Active=True Then $ResizeBad5_Direction+=1
    If $ResizeBad6Active=True Then $ResizeBad6_Direction+=1
    If $ResizeBad7Active=True Then $ResizeBad7_Direction+=1
    If $ResizeBad8Active=True Then $ResizeBad8_Direction+=1
    If $ResizeBad9Active=True Then $ResizeBad9_Direction+=1
    If $ResizeBad10Active=True Then $ResizeBad10_Direction+=1
    If $ResizeBad11Active=True Then $ResizeBad11_Direction+=1
    If $ResizeBad12Active=True Then $ResizeBad12_Direction+=1
    If $ResizeBad13Active=True Then $ResizeBad13_Direction+=1
    If $ResizeBad14Active=True Then $ResizeBad14_Direction+=1
    If $ResizeBad15Active=True Then $ResizeBad15_Direction+=1
    If $ResizeBad16Active=True Then $ResizeBad16_Direction+=1
    If $ResizeBad17Active=True Then $ResizeBad17_Direction+=1
    If $ResizeBad18Active=True Then $ResizeBad18_Direction+=1
    If $ResizeBad19Active=True Then $ResizeBad19_Direction+=1
    If $ResizeBad20Active=True Then $ResizeBad20_Direction+=1
    If $ResizeBad21Active=True Then $ResizeBad21_Direction+=1
    If $ResizeBad22Active=True Then $ResizeBad22_Direction+=1
    If $ResizeBad23Active=True Then $ResizeBad23_Direction+=1
    If $ResizeBad24Active=True Then $ResizeBad24_Direction+=1
    If $ResizeBad25Active=True Then $ResizeBad25_Direction+=1
    If $ResizeBad26Active=True Then $ResizeBad26_Direction+=1
    If $ResizeBad27Active=True Then $ResizeBad27_Direction+=1
    If $ResizeBad28Active=True Then $ResizeBad28_Direction+=1
    If $ResizeBad29Active=True Then $ResizeBad29_Direction+=1
    If $ResizeBad30Active=True Then $ResizeBad30_Direction+=1
    If $ResizeBad31Active=True Then $ResizeBad31_Direction+=1
    If $ResizeBad32Active=True Then $ResizeBad32_Direction+=1
    If $ResizeBad33Active=True Then $ResizeBad33_Direction+=1
    If $ResizeBad34Active=True Then $ResizeBad34_Direction+=1
    If $ResizeBad35Active=True Then $ResizeBad35_Direction+=1
    If $ResizeBad36Active=True Then $ResizeBad36_Direction+=1
    If $ResizeBad37Active=True Then $ResizeBad37_Direction+=1
    If $ResizeBad38Active=True Then $ResizeBad38_Direction+=1
    If $ResizeBad39Active=True Then $ResizeBad39_Direction+=1
    If $ResizeBad40Active=True Then $ResizeBad40_Direction+=1

    If $ResizeBad1_Direction>Random(60, 200, 1) Then
        $ResizeBad1_Direction=0
        If $MousePos[0]<$ResizeBad1x Then
            $Random1=Random(-10, 1, 1)
        Else
            $Random1=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad1y Then
            $Random1b=Random(-10, 1, 1)
        Else
            $Random1b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad2_Direction>Random(60, 200, 1) Then
        $ResizeBad2_Direction=0
        If $MousePos[0]<$ResizeBad2x Then
            $Random2=Random(-10, 1, 1)
        Else
            $Random2=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad2y Then
            $Random2b=Random(-10, 1, 1)
        Else
            $Random2b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad3_Direction>Random(60, 200, 1) Then
        $ResizeBad3_Direction=0
        If $MousePos[0]<$ResizeBad3x Then
            $Random3=Random(-10, 1, 1)
        Else
            $Random3=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad3y Then
            $Random3b=Random(-10, 1, 1)
        Else
            $Random3b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad4_Direction>Random(60, 200, 1) Then
        $ResizeBad4_Direction=0
        If $MousePos[0]<$ResizeBad4x Then
            $Random4=Random(-10, 1, 1)
        Else
            $Random4=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad4y Then
            $Random4b=Random(-10, 1, 1)
        Else
            $Random4b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad5_Direction>Random(60, 200, 1) Then
        $ResizeBad5_Direction=0
        If $MousePos[0]<$ResizeBad5x Then
            $Random5=Random(-10, 1, 1)
        Else
            $Random5=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad5y Then
            $Random5b=Random(-10, 1, 1)
        Else
            $Random5b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad6_Direction>Random(60, 200, 1) Then
        $ResizeBad6_Direction=0
        If $MousePos[0]<$ResizeBad6x Then
            $Random6=Random(-10, 1, 1)
        Else
            $Random6=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad6y Then
            $Random6b=Random(-10, 1, 1)
        Else
            $Random6b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad7_Direction>Random(60, 200, 1) Then
        $ResizeBad7_Direction=0
        If $MousePos[0]<$ResizeBad7x Then
            $Random7=Random(-10, 1, 1)
        Else
            $Random7=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad7y Then
            $Random7b=Random(-10, 1, 1)
        Else
            $Random7b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad8_Direction>Random(60, 200, 1) Then
        $ResizeBad8_Direction=0
        If $MousePos[0]<$ResizeBad8x Then
            $Random8=Random(-10, 1, 1)
        Else
            $Random8=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad8y Then
            $Random8b=Random(-10, 1, 1)
        Else
            $Random8b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad9_Direction>Random(60, 200, 1) Then
        $ResizeBad9_Direction=0
        If $MousePos[0]<$ResizeBad9x Then
            $Random9=Random(-10, 1, 1)
        Else
            $Random9=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad9y Then
            $Random9b=Random(-10, 1, 1)
        Else
            $Random9b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad10_Direction>Random(60, 200, 1) Then
        $ResizeBad10_Direction=0
        If $MousePos[0]<$ResizeBad10x Then
            $Random10=Random(-10, 1, 1)
        Else
            $Random10=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad10y Then
            $Random10b=Random(-10, 1, 1)
        Else
            $Random10b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad11_Direction>Random(60, 200, 1) Then
        $ResizeBad11_Direction=0
        If $MousePos[0]<$ResizeBad11x Then
            $Random11=Random(-10, 1, 1)
        Else
            $Random11=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad11y Then
            $Random11b=Random(-10, 1, 1)
        Else
            $Random11b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad12_Direction>Random(60, 200, 1) Then
        $ResizeBad12_Direction=0
        If $MousePos[0]<$ResizeBad12x Then
            $Random12=Random(-10, 1, 1)
        Else
            $Random12=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad12y Then
            $Random12b=Random(-10, 1, 1)
        Else
            $Random12b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad13_Direction>Random(60, 200, 1) Then
        $ResizeBad13_Direction=0
        If $MousePos[0]<$ResizeBad13x Then
            $Random13=Random(-10, 1, 1)
        Else
            $Random13=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad13y Then
            $Random13b=Random(-10, 1, 1)
        Else
            $Random13b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad14_Direction>Random(60, 200, 1) Then
        $ResizeBad14_Direction=0
        If $MousePos[0]<$ResizeBad14x Then
            $Random14=Random(-10, 1, 1)
        Else
            $Random14=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad14y Then
            $Random14b=Random(-10, 1, 1)
        Else
            $Random14b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad15_Direction>Random(60, 200, 1) Then
        $ResizeBad15_Direction=0
        If $MousePos[0]<$ResizeBad15x Then
            $Random15=Random(-10, 1, 1)
        Else
            $Random15=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad15y Then
            $Random15b=Random(-10, 1, 1)
        Else
            $Random15b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad16_Direction>Random(60, 200, 1) Then
        $ResizeBad16_Direction=0
        If $MousePos[0]<$ResizeBad16x Then
            $Random16=Random(-10, 1, 1)
        Else
            $Random16=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad16y Then
            $Random16b=Random(-10, 1, 1)
        Else
            $Random16b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad17_Direction>Random(60, 200, 1) Then
        $ResizeBad17_Direction=0
        If $MousePos[0]<$ResizeBad17x Then
            $Random17=Random(-10, 1, 1)
        Else
            $Random17=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad17y Then
            $Random17b=Random(-10, 1, 1)
        Else
            $Random17b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad18_Direction>Random(60, 200, 1) Then
        $ResizeBad18_Direction=0
        If $MousePos[0]<$ResizeBad18x Then
            $Random18=Random(-10, 1, 1)
        Else
            $Random18=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad18y Then
            $Random18b=Random(-10, 1, 1)
        Else
            $Random18b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad19_Direction>Random(60, 200, 1) Then
        $ResizeBad19_Direction=0
        If $MousePos[0]<$ResizeBad19x Then
            $Random19=Random(-10, 1, 1)
        Else
            $Random19=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad19y Then
            $Random19b=Random(-10, 1, 1)
        Else
            $Random19b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad20_Direction>Random(60, 200, 1) Then
        $ResizeBad20_Direction=0
        If $MousePos[0]<$ResizeBad20x Then
            $Random20=Random(-10, 1, 1)
        Else
            $Random20=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad20y Then
            $Random20b=Random(-10, 1, 1)
        Else
            $Random20b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad21_Direction>Random(60, 200, 1) Then
        $ResizeBad21_Direction=0
        If $MousePos[0]<$ResizeBad21x Then
            $Random21=Random(-10, 1, 1)
        Else
            $Random21=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad21y Then
            $Random21b=Random(-10, 1, 1)
        Else
            $Random21b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad22_Direction>Random(60, 200, 1) Then
        $ResizeBad22_Direction=0
        If $MousePos[0]<$ResizeBad22x Then
            $Random22=Random(-10, 1, 1)
        Else
            $Random22=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad22y Then
            $Random22b=Random(-10, 1, 1)
        Else
            $Random22b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad23_Direction>Random(60, 200, 1) Then
        $ResizeBad23_Direction=0
        If $MousePos[0]<$ResizeBad23x Then
            $Random23=Random(-10, 1, 1)
        Else
            $Random23=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad23y Then
            $Random23b=Random(-10, 1, 1)
        Else
            $Random23b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad24_Direction>Random(60, 200, 1) Then
        $ResizeBad24_Direction=0
        If $MousePos[0]<$ResizeBad24x Then
            $Random24=Random(-10, 1, 1)
        Else
            $Random24=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad24y Then
            $Random24b=Random(-10, 1, 1)
        Else
            $Random24b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad25_Direction>Random(60, 200, 1) Then
        $ResizeBad25_Direction=0
        If $MousePos[0]<$ResizeBad25x Then
            $Random25=Random(-10, 1, 1)
        Else
            $Random25=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad25y Then
            $Random25b=Random(-10, 1, 1)
        Else
            $Random25b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad26_Direction>Random(60, 200, 1) Then
        $ResizeBad26_Direction=0
        If $MousePos[0]<$ResizeBad26x Then
            $Random26=Random(-10, 1, 1)
        Else
            $Random26=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad26y Then
            $Random26b=Random(-10, 1, 1)
        Else
            $Random26b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad27_Direction>Random(60, 200, 1) Then
        $ResizeBad27_Direction=0
        If $MousePos[0]<$ResizeBad27x Then
            $Random27=Random(-10, 1, 1)
        Else
            $Random27=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad27y Then
            $Random27b=Random(-10, 1, 1)
        Else
            $Random27b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad28_Direction>Random(60, 200, 1) Then
        $ResizeBad28_Direction=0
        If $MousePos[0]<$ResizeBad28x Then
            $Random28=Random(-10, 1, 1)
        Else
            $Random28=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad28y Then
            $Random28b=Random(-10, 1, 1)
        Else
            $Random28b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad29_Direction>Random(60, 200, 1) Then
        $ResizeBad29_Direction=0
        If $MousePos[0]<$ResizeBad29x Then
            $Random29=Random(-10, 1, 1)
        Else
            $Random29=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad29y Then
            $Random29b=Random(-10, 1, 1)
        Else
            $Random29b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad30_Direction>Random(60, 200, 1) Then
        $ResizeBad30_Direction=0
        If $MousePos[0]<$ResizeBad30x Then
            $Random30=Random(-10, 1, 1)
        Else
            $Random30=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad30y Then
            $Random30b=Random(-10, 1, 1)
        Else
            $Random30b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad31_Direction>Random(60, 200, 1) Then
        $ResizeBad31_Direction=0
        If $MousePos[0]<$ResizeBad31x Then
            $Random31=Random(-10, 1, 1)
        Else
            $Random31=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad31y Then
            $Random31b=Random(-10, 1, 1)
        Else
            $Random31b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad32_Direction>Random(60, 200, 1) Then
        $ResizeBad32_Direction=0
        If $MousePos[0]<$ResizeBad32x Then
            $Random32=Random(-10, 1, 1)
        Else
            $Random32=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad32y Then
            $Random32b=Random(-10, 1, 1)
        Else
            $Random32b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad33_Direction>Random(60, 200, 1) Then
        $ResizeBad33_Direction=0
        If $MousePos[0]<$ResizeBad33x Then
            $Random33=Random(-10, 1, 1)
        Else
            $Random33=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad33y Then
            $Random33b=Random(-10, 1, 1)
        Else
            $Random33b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad34_Direction>Random(60, 200, 1) Then
        $ResizeBad34_Direction=0
        If $MousePos[0]<$ResizeBad34x Then
            $Random34=Random(-10, 1, 1)
        Else
            $Random34=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad34y Then
            $Random34b=Random(-10, 1, 1)
        Else
            $Random34b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad35_Direction>Random(60, 200, 1) Then
        $ResizeBad35_Direction=0
        If $MousePos[0]<$ResizeBad35x Then
            $Random35=Random(-10, 1, 1)
        Else
            $Random35=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad35y Then
            $Random35b=Random(-10, 1, 1)
        Else
            $Random35b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad36_Direction>Random(60, 200, 1) Then
        $ResizeBad36_Direction=0
        If $MousePos[0]<$ResizeBad36x Then
            $Random36=Random(-10, 1, 1)
        Else
            $Random36=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad36y Then
            $Random36b=Random(-10, 1, 1)
        Else
            $Random36b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad37_Direction>Random(60, 200, 1) Then
        $ResizeBad37_Direction=0
        If $MousePos[0]<$ResizeBad37x Then
            $Random37=Random(-10, 1, 1)
        Else
            $Random37=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad37y Then
            $Random37b=Random(-10, 1, 1)
        Else
            $Random37b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad38_Direction>Random(60, 200, 1) Then
        $ResizeBad38_Direction=0
        If $MousePos[0]<$ResizeBad38x Then
            $Random38=Random(-10, 1, 1)
        Else
            $Random38=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad38y Then
            $Random38b=Random(-10, 1, 1)
        Else
            $Random38b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad39_Direction>Random(60, 200, 1) Then
        $ResizeBad39_Direction=0
        If $MousePos[0]<$ResizeBad39x Then
            $Random39=Random(-10, 1, 1)
        Else
            $Random39=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad39y Then
            $Random39b=Random(-10, 1, 1)
        Else
            $Random39b=Random(-1, 10, 1)
        EndIf
    EndIf
    If $ResizeBad40_Direction>Random(60, 200, 1) Then
        $ResizeBad40_Direction=0
        If $MousePos[0]<$ResizeBad40x Then
            $Random40=Random(-10, 1, 1)
        Else
            $Random40=Random(-1, 10, 1)
        EndIf
        If $MousePos[1]<$ResizeBad40y Then
            $Random40b=Random(-10, 1, 1)
        Else
            $Random40b=Random(-1, 10, 1)
        EndIf
    EndIf
    $ResizeBad1x+=$Random1
    $ResizeBad1y+=$Random1b
    $ResizeBad2x+=$Random2
    $ResizeBad2y+=$Random2b
    $ResizeBad3x+=$Random3
    $ResizeBad3y+=$Random3b
    $ResizeBad4x+=$Random4
    $ResizeBad4y+=$Random4b
    $ResizeBad5x+=$Random5
    $ResizeBad5y+=$Random5b
    $ResizeBad6x+=$Random6
    $ResizeBad6y+=$Random6b
    $ResizeBad7x+=$Random7
    $ResizeBad7y+=$Random7b
    $ResizeBad8x+=$Random8
    $ResizeBad8y+=$Random8b
    $ResizeBad9x+=$Random9
    $ResizeBad9y+=$Random9b
    $ResizeBad10x+=$Random10
    $ResizeBad10y+=$Random10b
    $ResizeBad11x+=$Random11
    $ResizeBad11y+=$Random11b
    $ResizeBad12x+=$Random12
    $ResizeBad12y+=$Random12b
    $ResizeBad13x+=$Random13
    $ResizeBad13y+=$Random13b
    $ResizeBad14x+=$Random14
    $ResizeBad14y+=$Random14b
    $ResizeBad15x+=$Random15
    $ResizeBad15y+=$Random15b
    $ResizeBad16x+=$Random16
    $ResizeBad16y+=$Random16b
    $ResizeBad17x+=$Random17
    $ResizeBad17y+=$Random17b
    $ResizeBad18x+=$Random18
    $ResizeBad18y+=$Random18b
    $ResizeBad19x+=$Random19
    $ResizeBad19y+=$Random19b
    $ResizeBad20x+=$Random20
    $ResizeBad20y+=$Random20b
    $ResizeBad21x+=$Random21
    $ResizeBad21y+=$Random21b
    $ResizeBad22x+=$Random22
    $ResizeBad22y+=$Random22b
    $ResizeBad23x+=$Random23
    $ResizeBad23y+=$Random23b
    $ResizeBad24x+=$Random24
    $ResizeBad24y+=$Random24b
    $ResizeBad25x+=$Random25
    $ResizeBad25y+=$Random25b
    $ResizeBad26x+=$Random26
    $ResizeBad26y+=$Random26b
    $ResizeBad27x+=$Random27
    $ResizeBad27y+=$Random27b
    $ResizeBad28x+=$Random28
    $ResizeBad28y+=$Random28b
    $ResizeBad29x+=$Random29
    $ResizeBad29y+=$Random29b
    $ResizeBad30x+=$Random30
    $ResizeBad30y+=$Random30b
    $ResizeBad31x+=$Random31
    $ResizeBad31y+=$Random31b
    $ResizeBad32x+=$Random32
    $ResizeBad32y+=$Random32b
    $ResizeBad33x+=$Random33
    $ResizeBad33y+=$Random33b
    $ResizeBad34x+=$Random34
    $ResizeBad34y+=$Random34b
    $ResizeBad35x+=$Random35
    $ResizeBad35y+=$Random35b
    $ResizeBad36x+=$Random36
    $ResizeBad36y+=$Random36b
    $ResizeBad37x+=$Random37
    $ResizeBad37y+=$Random37b
    $ResizeBad38x+=$Random38
    $ResizeBad38y+=$Random38b
    $ResizeBad39x+=$Random39
    $ResizeBad39y+=$Random39b
    $ResizeBad40x+=$Random40
    $ResizeBad40y+=$Random40b
    If $ResizeBad1x<0 Then $ResizeBad1x=1
    If $ResizeBad1x>1200 Then $ResizeBad1x=1199
    If $ResizeBad1y<0 Then $ResizeBad1y=1
    If $ResizeBad1y>800 Then $ResizeBad1y=799
    If $ResizeBad2x<0 Then $ResizeBad2x=1
    If $ResizeBad2x>1200 Then $ResizeBad2x=1199
    If $ResizeBad2y<0 Then $ResizeBad2y=1
    If $ResizeBad2y>800 Then $ResizeBad2y=799
    If $ResizeBad3x<0 Then $ResizeBad3x=1
    If $ResizeBad3x>1200 Then $ResizeBad3x=1199
    If $ResizeBad3y<0 Then $ResizeBad3y=1
    If $ResizeBad3y>800 Then $ResizeBad3y=799
    If $ResizeBad4x<0 Then $ResizeBad4x=1
    If $ResizeBad4x>1200 Then $ResizeBad4x=1199
    If $ResizeBad4y<0 Then $ResizeBad4y=1
    If $ResizeBad4y>800 Then $ResizeBad4y=799
    If $ResizeBad5x<0 Then $ResizeBad5x=1
    If $ResizeBad5x>1200 Then $ResizeBad5x=1199
    If $ResizeBad5y<0 Then $ResizeBad5y=1
    If $ResizeBad5y>800 Then $ResizeBad5y=799
    If $ResizeBad6x<0 Then $ResizeBad6x=1
    If $ResizeBad6x>1200 Then $ResizeBad6x=1199
    If $ResizeBad6y<0 Then $ResizeBad6y=1
    If $ResizeBad6y>800 Then $ResizeBad6y=799
    If $ResizeBad7x<0 Then $ResizeBad7x=1
    If $ResizeBad7x>1200 Then $ResizeBad7x=1199
    If $ResizeBad7y<0 Then $ResizeBad7y=1
    If $ResizeBad7y>800 Then $ResizeBad7y=799
    If $ResizeBad8x<0 Then $ResizeBad8x=1
    If $ResizeBad8x>1200 Then $ResizeBad8x=1199
    If $ResizeBad8y<0 Then $ResizeBad8y=1
    If $ResizeBad8y>800 Then $ResizeBad8y=799
    If $ResizeBad9x<0 Then $ResizeBad9x=1
    If $ResizeBad9x>1200 Then $ResizeBad9x=1199
    If $ResizeBad9y<0 Then $ResizeBad9y=1
    If $ResizeBad9y>800 Then $ResizeBad9y=799
    If $ResizeBad10x<0 Then $ResizeBad10x=1
    If $ResizeBad10x>1200 Then $ResizeBad10x=1199
    If $ResizeBad10y<0 Then $ResizeBad10y=1
    If $ResizeBad10y>800 Then $ResizeBad10y=799
    If $ResizeBad11x<0 Then $ResizeBad11x=1
    If $ResizeBad11x>1200 Then $ResizeBad11x=1199
    If $ResizeBad11y<0 Then $ResizeBad11y=1
    If $ResizeBad11y>800 Then $ResizeBad11y=799
    If $ResizeBad12x<0 Then $ResizeBad12x=1
    If $ResizeBad12x>1200 Then $ResizeBad12x=1199
    If $ResizeBad12y<0 Then $ResizeBad12y=1
    If $ResizeBad12y>800 Then $ResizeBad12y=799
    If $ResizeBad13x<0 Then $ResizeBad13x=1
    If $ResizeBad13x>1200 Then $ResizeBad13x=1199
    If $ResizeBad13y<0 Then $ResizeBad13y=1
    If $ResizeBad13y>800 Then $ResizeBad13y=799
    If $ResizeBad14x<0 Then $ResizeBad14x=1
    If $ResizeBad14x>1200 Then $ResizeBad14x=1199
    If $ResizeBad14y<0 Then $ResizeBad14y=1
    If $ResizeBad14y>800 Then $ResizeBad14y=799
    If $ResizeBad15x<0 Then $ResizeBad15x=1
    If $ResizeBad15x>1200 Then $ResizeBad15x=1199
    If $ResizeBad15y<0 Then $ResizeBad15y=1
    If $ResizeBad15y>800 Then $ResizeBad15y=799
    If $ResizeBad16x<0 Then $ResizeBad16x=1
    If $ResizeBad16x>1200 Then $ResizeBad16x=1199
    If $ResizeBad16y<0 Then $ResizeBad16y=1
    If $ResizeBad16y>800 Then $ResizeBad16y=799
    If $ResizeBad17x<0 Then $ResizeBad17x=1
    If $ResizeBad17x>1200 Then $ResizeBad17x=1199
    If $ResizeBad17y<0 Then $ResizeBad17y=1
    If $ResizeBad17y>800 Then $ResizeBad17y=799
    If $ResizeBad18x<0 Then $ResizeBad18x=1
    If $ResizeBad18x>1200 Then $ResizeBad18x=1199
    If $ResizeBad18y<0 Then $ResizeBad18y=1
    If $ResizeBad18y>800 Then $ResizeBad18y=799
    If $ResizeBad19x<0 Then $ResizeBad19x=1
    If $ResizeBad19x>1200 Then $ResizeBad19x=1199
    If $ResizeBad19y<0 Then $ResizeBad19y=1
    If $ResizeBad19y>800 Then $ResizeBad19y=799
    If $ResizeBad20x<0 Then $ResizeBad20x=1
    If $ResizeBad20x>1200 Then $ResizeBad20x=1199
    If $ResizeBad20y<0 Then $ResizeBad20y=1
    If $ResizeBad20y>800 Then $ResizeBad20y=799
    If $ResizeBad21x<0 Then $ResizeBad21x=1
    If $ResizeBad21x>1200 Then $ResizeBad21x=1199
    If $ResizeBad21y<0 Then $ResizeBad21y=1
    If $ResizeBad21y>800 Then $ResizeBad21y=799
    If $ResizeBad22x<0 Then $ResizeBad22x=1
    If $ResizeBad22x>1200 Then $ResizeBad22x=1199
    If $ResizeBad22y<0 Then $ResizeBad22y=1
    If $ResizeBad22y>800 Then $ResizeBad22y=799
    If $ResizeBad23x<0 Then $ResizeBad23x=1
    If $ResizeBad23x>1200 Then $ResizeBad23x=1199
    If $ResizeBad23y<0 Then $ResizeBad23y=1
    If $ResizeBad23y>800 Then $ResizeBad23y=799
    If $ResizeBad24x<0 Then $ResizeBad24x=1
    If $ResizeBad24x>1200 Then $ResizeBad24x=1199
    If $ResizeBad24y<0 Then $ResizeBad24y=1
    If $ResizeBad24y>800 Then $ResizeBad24y=799
    If $ResizeBad25x<0 Then $ResizeBad25x=1
    If $ResizeBad25x>1200 Then $ResizeBad25x=1199
    If $ResizeBad25y<0 Then $ResizeBad25y=1
    If $ResizeBad25y>800 Then $ResizeBad25y=799
    If $ResizeBad26x<0 Then $ResizeBad26x=1
    If $ResizeBad26x>1200 Then $ResizeBad26x=1199
    If $ResizeBad26y<0 Then $ResizeBad26y=1
    If $ResizeBad26y>800 Then $ResizeBad26y=799
    If $ResizeBad27x<0 Then $ResizeBad27x=1
    If $ResizeBad27x>1200 Then $ResizeBad27x=1199
    If $ResizeBad27y<0 Then $ResizeBad27y=1
    If $ResizeBad27y>800 Then $ResizeBad27y=799
    If $ResizeBad28x<0 Then $ResizeBad28x=1
    If $ResizeBad28x>1200 Then $ResizeBad28x=1199
    If $ResizeBad28y<0 Then $ResizeBad28y=1
    If $ResizeBad28y>800 Then $ResizeBad8y=799
    If $ResizeBad29x<0 Then $ResizeBad29x=1
    If $ResizeBad29x>1200 Then $ResizeBad29x=1199
    If $ResizeBad29y<0 Then $ResizeBad29y=1
    If $ResizeBad29y>800 Then $ResizeBad29y=799
    If $ResizeBad30x<0 Then $ResizeBad30x=1
    If $ResizeBad30x>1200 Then $ResizeBad30x=1199
    If $ResizeBad30y<0 Then $ResizeBad30y=1
    If $ResizeBad30y>800 Then $ResizeBad30y=799
    If $ResizeBad31x<0 Then $ResizeBad31x=1
    If $ResizeBad31x>1200 Then $ResizeBad31x=1199
    If $ResizeBad31y<0 Then $ResizeBad31y=1
    If $ResizeBad31y>800 Then $ResizeBad31y=799
    If $ResizeBad32x<0 Then $ResizeBad32x=1
    If $ResizeBad32x>1200 Then $ResizeBad32x=1199
    If $ResizeBad32y<0 Then $ResizeBad32y=1
    If $ResizeBad32y>800 Then $ResizeBad32y=799
    If $ResizeBad33x<0 Then $ResizeBad33x=1
    If $ResizeBad33x>1200 Then $ResizeBad33x=1199
    If $ResizeBad33y<0 Then $ResizeBad33y=1
    If $ResizeBad33y>800 Then $ResizeBad33y=799
    If $ResizeBad34x<0 Then $ResizeBad34x=1
    If $ResizeBad34x>1200 Then $ResizeBad34x=1199
    If $ResizeBad34y<0 Then $ResizeBad34y=1
    If $ResizeBad34y>800 Then $ResizeBad34y=799
    If $ResizeBad35x<0 Then $ResizeBad35x=1
    If $ResizeBad35x>1200 Then $ResizeBad35x=1199
    If $ResizeBad35y<0 Then $ResizeBad35y=1
    If $ResizeBad35y>800 Then $ResizeBad35y=799
    If $ResizeBad36x<0 Then $ResizeBad36x=1
    If $ResizeBad36x>1200 Then $ResizeBad36x=1199
    If $ResizeBad36y<0 Then $ResizeBad36y=1
    If $ResizeBad36y>800 Then $ResizeBad36y=799
    If $ResizeBad37x<0 Then $ResizeBad37x=1
    If $ResizeBad37x>1200 Then $ResizeBad37x=1199
    If $ResizeBad37y<0 Then $ResizeBad37y=1
    If $ResizeBad37y>800 Then $ResizeBad37y=799
    If $ResizeBad38x<0 Then $ResizeBad38x=1
    If $ResizeBad38x>1200 Then $ResizeBad38x=1199
    If $ResizeBad38y<0 Then $ResizeBad38y=1
    If $ResizeBad38y>800 Then $ResizeBad38y=799
    If $ResizeBad39x<0 Then $ResizeBad39x=1
    If $ResizeBad39x>1200 Then $ResizeBad39x=1199
    If $ResizeBad39y<0 Then $ResizeBad39y=1
    If $ResizeBad39y>800 Then $ResizeBad39y=799
    If $ResizeBad40x<0 Then $ResizeBad40x=1
    If $ResizeBad40x>1200 Then $ResizeBad40x=1199
    If $ResizeBad40y<0 Then $ResizeBad40y=1
    If $ResizeBad40y>800 Then $ResizeBad40y=799

    If $1>210 Then $1=0
    If $1>107 Then $ResizeBads-=1
    If $1<105 Then $ResizeBads+=1
    If $1>102 Then $ResizeBads2+=1
    If $1<105 Then $ResizeBads2-=1
    GUICtrlSetPos($ResizeBad1, $ResizeBad1x-$ResizeBads/1.9, $ResizeBad1y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad2, $ResizeBad2x-$ResizeBads/1.9, $ResizeBad2y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad3, $ResizeBad3x-$ResizeBads/1.9, $ResizeBad3y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad4, $ResizeBad4x-$ResizeBads/1.9, $ResizeBad4y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad5, $ResizeBad5x-$ResizeBads/1.9, $ResizeBad5y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad6, $ResizeBad6x-$ResizeBads2/1.9, $ResizeBad6y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad7, $ResizeBad7x-$ResizeBads2/1.9, $ResizeBad7y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad8, $ResizeBad8x-$ResizeBads2/1.9, $ResizeBad8y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad9, $ResizeBad9x-$ResizeBads2/1.9, $ResizeBad9y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad10, $ResizeBad10x-$ResizeBads2/1.9, $ResizeBad10y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad11, $ResizeBad11x-$ResizeBads/1.9, $ResizeBad11y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad12, $ResizeBad12x-$ResizeBads/1.9, $ResizeBad12y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad13, $ResizeBad13x-$ResizeBads/1.9, $ResizeBad13y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad14, $ResizeBad14x-$ResizeBads/1.9, $ResizeBad14y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad15, $ResizeBad15x-$ResizeBads/1.9, $ResizeBad15y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad16, $ResizeBad16x-$ResizeBads2/1.9, $ResizeBad16y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad17, $ResizeBad17x-$ResizeBads2/1.9, $ResizeBad17y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad18, $ResizeBad18x-$ResizeBads2/1.9, $ResizeBad18y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad19, $ResizeBad19x-$ResizeBads2/1.9, $ResizeBad19y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad20, $ResizeBad20x-$ResizeBads2/1.9, $ResizeBad20y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad21, $ResizeBad21x-$ResizeBads/1.9, $ResizeBad21y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad22, $ResizeBad22x-$ResizeBads/1.9, $ResizeBad22y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad23, $ResizeBad23x-$ResizeBads/1.9, $ResizeBad23y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad24, $ResizeBad24x-$ResizeBads/1.9, $ResizeBad24y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad25, $ResizeBad25x-$ResizeBads/1.9, $ResizeBad25y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad26, $ResizeBad26x-$ResizeBads2/1.9, $ResizeBad26y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad27, $ResizeBad27x-$ResizeBads2/1.9, $ResizeBad27y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad28, $ResizeBad28x-$ResizeBads2/1.9, $ResizeBad28y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad29, $ResizeBad29x-$ResizeBads2/1.9, $ResizeBad29y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad30, $ResizeBad30x-$ResizeBads2/1.9, $ResizeBad30y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad31, $ResizeBad31x-$ResizeBads/1.9, $ResizeBad31y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad32, $ResizeBad32x-$ResizeBads/1.9, $ResizeBad32y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad33, $ResizeBad33x-$ResizeBads/1.9, $ResizeBad33y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad34, $ResizeBad34x-$ResizeBads/1.9, $ResizeBad34y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad35, $ResizeBad35x-$ResizeBads/1.9, $ResizeBad35y-$ResizeBads/1.9, $ResizeBads, $ResizeBads)
    GUICtrlSetPos($ResizeBad36, $ResizeBad36x-$ResizeBads2/1.9, $ResizeBad36y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad37, $ResizeBad37x-$ResizeBads2/1.9, $ResizeBad37y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad38, $ResizeBad38x-$ResizeBads2/1.9, $ResizeBad38y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad39, $ResizeBad39x-$ResizeBads2/1.9, $ResizeBad39y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
    GUICtrlSetPos($ResizeBad40, $ResizeBad40x-$ResizeBads2/1.9, $ResizeBad40y-$ResizeBads2/1.9, $ResizeBads2, $ResizeBads2)
EndFunc

Func Case0()
    $Steps=1
    If TimerDiff($Timer)>10000 Then $Steps=2
    If TimerDiff($Timer)>20000 Then $Steps=3
    If TimerDiff($Timer)>40000 Then $Steps=4
    If TimerDiff($Timer)>80000 Then $Steps=5
    If TimerDiff($Timer)>120000 Then $Steps=6

    Sleep(1)
    If $MousePos[1]<100 and $MousePos[1]>0 Then
        If $MousePos[0]-50>$HorizontalBad1x Then $HorizontalBad1x+=$Steps
        If $MousePos[0]-50<$HorizontalBad1x Then $HorizontalBad1x-=$Steps
        GUICtrlSetPos($HorizontalBad1, $HorizontalBad1x, 0)
    EndIf
    If $MousePos[1]<200 and $MousePos[1]>100 Then
        If $MousePos[0]-50>$HorizontalBad2x Then $HorizontalBad2x+=$Steps
        If $MousePos[0]-50<$HorizontalBad2x Then $HorizontalBad2x-=$Steps
        GUICtrlSetPos($HorizontalBad2, $HorizontalBad2x, 100)
    EndIf
    If $MousePos[1]<300 and $MousePos[1]>200 Then
        If $MousePos[0]-50>$HorizontalBad3x Then $HorizontalBad3x+=$Steps
        If $MousePos[0]-50<$HorizontalBad3x Then $HorizontalBad3x-=$Steps
        GUICtrlSetPos($HorizontalBad3, $HorizontalBad3x, 200)
    EndIf
    If $MousePos[1]<400 and $MousePos[1]>300 Then
        If $MousePos[0]-50>$HorizontalBad4x Then $HorizontalBad4x+=$Steps
        If $MousePos[0]-50<$HorizontalBad4x Then $HorizontalBad4x-=$Steps
        GUICtrlSetPos($HorizontalBad4, $HorizontalBad4x, 300)
    EndIf
    If $MousePos[1]<500 and $MousePos[1]>400 Then
        If $MousePos[0]-50>$HorizontalBad5x Then $HorizontalBad5x+=$Steps
        If $MousePos[0]-50<$HorizontalBad5x Then $HorizontalBad5x-=$Steps
        GUICtrlSetPos($HorizontalBad5, $HorizontalBad5x, 400)
    EndIf
    If $MousePos[1]<600 and $MousePos[1]>500 Then
        If $MousePos[0]-50>$HorizontalBad6x Then $HorizontalBad6x+=$Steps
        If $MousePos[0]-50<$HorizontalBad6x Then $HorizontalBad6x-=$Steps
        GUICtrlSetPos($HorizontalBad6, $HorizontalBad6x, 500)
    EndIf
    If $MousePos[1]<700 and $MousePos[1]>600 Then
        If $MousePos[0]-50>$HorizontalBad7x Then $HorizontalBad7x+=$Steps
        If $MousePos[0]-50<$HorizontalBad7x Then $HorizontalBad7x-=$Steps
        GUICtrlSetPos($HorizontalBad7, $HorizontalBad7x, 600)
    EndIf
    If $MousePos[1]<800 and $MousePos[1]>700 Then
        If $MousePos[0]-50>$HorizontalBad8x Then $HorizontalBad8x+=$Steps
        If $MousePos[0]-50<$HorizontalBad8x Then $HorizontalBad8x-=$Steps
        GUICtrlSetPos($HorizontalBad8, $HorizontalBad8x, 700)
    EndIf
    If $MousePos[0]<100 and $MousePos[0]>0 Then
        If $MousePos[1]-50>$VerticalBad1y Then $VerticalBad1y+=$Steps
        If $MousePos[1]-50<$VerticalBad1y Then $VerticalBad1y-=$Steps
        GUICtrlSetPos($VerticalBad1, 0, $VerticalBad1y)
    EndIf
    If $MousePos[0]<200 and $MousePos[0]>100 Then
        If $MousePos[1]-50>$VerticalBad2y Then $VerticalBad2y+=$Steps
        If $MousePos[1]-50<$VerticalBad2y Then $VerticalBad2y-=$Steps
        GUICtrlSetPos($VerticalBad2, 100, $VerticalBad2y)
    EndIf
    If $MousePos[0]<300 and $MousePos[0]>200 Then
        If $MousePos[1]-50>$VerticalBad3y Then $VerticalBad3y+=$Steps
        If $MousePos[1]-50<$VerticalBad3y Then $VerticalBad3y-=$Steps
        GUICtrlSetPos($VerticalBad3, 200, $VerticalBad3y)
    EndIf
    If $MousePos[0]<400 and $MousePos[0]>300 Then
        If $MousePos[1]-50>$VerticalBad4y Then $VerticalBad4y+=$Steps
        If $MousePos[1]-50<$VerticalBad4y Then $VerticalBad4y-=$Steps
        GUICtrlSetPos($VerticalBad4, 300, $VerticalBad4y)
    EndIf
    If $MousePos[0]<500 and $MousePos[0]>400 Then
        If $MousePos[1]-50>$VerticalBad5y Then $VerticalBad5y+=$Steps
        If $MousePos[1]-50<$VerticalBad5y Then $VerticalBad5y-=$Steps
        GUICtrlSetPos($VerticalBad5, 400, $VerticalBad5y)
    EndIf
    If $MousePos[0]<600 and $MousePos[0]>500 Then
        If $MousePos[1]-50>$VerticalBad6y Then $VerticalBad6y+=$Steps
        If $MousePos[1]-50<$VerticalBad6y Then $VerticalBad6y-=$Steps
        GUICtrlSetPos($VerticalBad6, 500, $VerticalBad6y)
    EndIf
    If $MousePos[0]<700 and $MousePos[0]>600 Then
        If $MousePos[1]-50>$VerticalBad7y Then $VerticalBad7y+=$Steps
        If $MousePos[1]-50<$VerticalBad7y Then $VerticalBad7y-=$Steps
        GUICtrlSetPos($VerticalBad7, 600, $VerticalBad7y)
    EndIf
    If $MousePos[0]<800 and $MousePos[0]>700 Then
        If $MousePos[1]-50>$VerticalBad8y Then $VerticalBad8y+=$Steps
        If $MousePos[1]-50<$VerticalBad8y Then $VerticalBad8y-=$Steps
        GUICtrlSetPos($VerticalBad8, 700, $VerticalBad8y)
    EndIf
    If $MousePos[0]<900 and $MousePos[0]>800 Then
        If $MousePos[1]-50>$VerticalBad9y Then $VerticalBad9y+=$Steps
        If $MousePos[1]-50<$VerticalBad9y Then $VerticalBad9y-=$Steps
        GUICtrlSetPos($VerticalBad9, 800, $VerticalBad9y)
    EndIf
    If $MousePos[0]<1000 and $MousePos[0]>900 Then
        If $MousePos[1]-50>$VerticalBad10y Then $VerticalBad10y+=$Steps
        If $MousePos[1]-50<$VerticalBad10y Then $VerticalBad10y-=$Steps
        GUICtrlSetPos($VerticalBad10, 900, $VerticalBad10y)
    EndIf
    If $MousePos[0]<1100 and $MousePos[0]>1000 Then
        If $MousePos[1]-50>$VerticalBad11y Then $VerticalBad11y+=$Steps
        If $MousePos[1]-50<$VerticalBad11y Then $VerticalBad11y-=$Steps
        GUICtrlSetPos($VerticalBad11, 1000, $VerticalBad11y)
    EndIf
    If $MousePos[0]<1200 and $MousePos[0]>1100 Then
        If $MousePos[1]-50>$VerticalBad12y Then $VerticalBad12y+=$Steps
        If $MousePos[1]-50<$VerticalBad12y Then $VerticalBad12y-=$Steps
        GUICtrlSetPos($VerticalBad12, 1100, $VerticalBad12y)
    EndIf
EndFunc

Func GameMenu()
    GUICtrlSetState($Stage0, $GUI_SHOW)
    GUICtrlSetState($Stage1, $GUI_SHOW)
    GUICtrlSetState($Stage2, $GUI_SHOW)


    While 1
        $msg=GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Stage0
                $CurrentState=0
                StartState0()
                ExitLoop
            Case $Stage1
                $CurrentState=1
                StartState1()
                ExitLoop
            Case $Stage2
                $CurrentState=2
                StartState2()
                ExitLoop
        EndSwitch
    WEnd

    GUICtrlSetState($Stage0, $GUI_HIDE)
    GUICtrlSetState($Stage1, $GUI_HIDE)
    GUICtrlSetState($Stage2, $GUI_HIDE)
    $Timer=TimerInit()
EndFunc

Func StartState0()
    $HorizontalBad1x=-100
    $HorizontalBad2x=1200
    $HorizontalBad3x=-100
    $HorizontalBad4x=1200
    $HorizontalBad5x=-100
    $HorizontalBad6x=1200
    $HorizontalBad7x=-100
    $HorizontalBad8x=1200
    $VerticalBad1y=-100
    $VerticalBad2y=800
    $VerticalBad3y=-100
    $VerticalBad4y=800
    $VerticalBad5y=-100
    $VerticalBad6y=800
    $VerticalBad7y=-100
    $VerticalBad8y=800
    $VerticalBad9y=-100
    $VerticalBad10y=800
    $VerticalBad11y=-100
    $VerticalBad12y=800
    $Timer=TimerInit()
EndFunc

Func Restartgame0()
     Local $ReadIni1=""
     Local $ReadIni2=""
     Local $ReadIni3=""
    $FinalTime=TimerDiff($Timer)
    GUICtrlSetPos($HorizontalBad1, -100, 0)
    GUICtrlSetPos($HorizontalBad2, 1200, 100)
    GUICtrlSetPos($HorizontalBad3, -100, 200)
    GUICtrlSetPos($HorizontalBad4, 1200, 300)
    GUICtrlSetPos($HorizontalBad5, -100, 400)
    GUICtrlSetPos($HorizontalBad6, 1200, 500)
    GUICtrlSetPos($HorizontalBad7, -100, 600)
    GUICtrlSetPos($HorizontalBad8, 1200, 700)
    GUICtrlSetPos($VerticalBad1, 0, -100)
    GUICtrlSetPos($VerticalBad2, 0, 800)
    GUICtrlSetPos($VerticalBad3, 0, -100)
    GUICtrlSetPos($VerticalBad4, 0, 800)
    GUICtrlSetPos($VerticalBad5, 0, -100)
    GUICtrlSetPos($VerticalBad6, 0, 800)
    GUICtrlSetPos($VerticalBad7, 0, -100)
    GUICtrlSetPos($VerticalBad8, 0, 800)
    GUICtrlSetPos($VerticalBad9, 0, -100)
    GUICtrlSetPos($VerticalBad10, 0, 800)
    GUICtrlSetPos($VerticalBad11, 0, -100)
    GUICtrlSetPos($VerticalBad12, 0, 800)

    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 0 1st", "Score", "0")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Score", "0")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Score", "0")
    $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 1st", "Name", "")
    $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Name", "")
    $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Name", "")
    GUICtrlSetData($PointLabel, "Score: " & $FinalTime & " milliseconds")
    If $ReadIni1<>"0" Then

        If $ReadIni1<$FinalTime Then
            $Name=InputBox("New High Score!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 1st", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 1st", "Name", $Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Score", $ReadIni1)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Name", $ReadIni1Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Score", $ReadIni2)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Name", $ReadIni2Name)
            EndIf
        ElseIf $ReadIni2<$FinalTime Then
            $Name=InputBox("Second Place!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Name", $Name)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Score", $ReadIni2)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Name", $ReadIni2Name)
            EndIf
        ElseIf $ReadIni3<$FinalTime Then
            $Name=InputBox("Third Place!", "What's your name?")
            If Not @error=1 Then
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Score", $FinalTime)
                IniWrite(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Name", $Name)
            EndIf
        EndIf
    Else
        $Name=InputBox("New High Score!", "What's your name?")
        If Not @error=1 Then
            IniWrite(@ScriptDir & "\Score.ini", "Stage 0 1st", "Score", $FinalTime)
            IniWrite(@ScriptDir & "\Score.ini", "Stage 0 1st", "Name", $Name)
        EndIf
    EndIf
    $ReadIni1=IniRead(@ScriptDir & "\Score.ini", "Stage 0 1st", "Score", "0")
    $ReadIni1Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 1st", "Name", "")
    $ReadIni2=IniRead(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Score", "0")
    $ReadIni2Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 2nd", "Name", "")
    $ReadIni3=IniRead(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Score", "0")
    $ReadIni3Name=IniRead(@ScriptDir & "\Score.ini", "Stage 0 3rd", "Name", "")
    GUICtrlSetData($Highscorelabel, $ReadIni1Name & ": " & $ReadIni1 & @CRLF & $ReadIni2Name & ": " & $ReadIni2 & @CRLF & $ReadIni3Name & ": " & $ReadIni3)
    GUICtrlSetState($PointLabel, $GUI_SHOW)
    GUICtrlSetState($Highscorelabel, $GUI_SHOW)
    GUICtrlSetState($ContinueLabel, $GUI_SHOW)
    While 1
        $msg=GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
        If _IsPressed(01) Then
            $MousePos=GUIGetCursorInfo($Gui)
            If $MousePos[1]<800 and $MousePos[1]>0 and $MousePos[0]>0 and $MousePos[0]<1200 Then ExitLoop
        EndIf
    WEnd
    While _IsPressed(01)
    WEnd
    GUICtrlSetState($PointLabel, $GUI_HIDE)
    GUICtrlSetState($ContinueLabel, $GUI_HIDE)
    GUICtrlSetState($Highscorelabel, $GUI_HIDE)
    GameMenu()
EndFunc
Edited by TheNorwegianUser

Share this post


Link to post
Share on other sites
willichan

Nothing much you can do about an anti-virus false positive, but hope that the next update fixes the problem.

Share this post


Link to post
Share on other sites
spudw2k

You could try compiling without using UPX.  UPX is often the culprit to trigger false-positives with Anti-Vir.

Edited by spudw2k

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×