Also ich hab das Problem bei meinen Script das kein Fenster aktiv ist also egal welches nicht direkt vom script aber trotzdem das Script selbst noch aktiv ist
Das ganze tritt direkt beim spielen auf. Da ich die Äpfel per gui erzeuge
wird das Fenster immer wieder in den Vordergrund gerufen und somit ist es unmöglich was anderes zu machen wärend das spiel läuft.
Ich hab versucht es so zu lösen das am ende der schleife immer States von den kompletten gui´s abgerufen wird und somit ermittelt wird ob nun alle nicht aktiv sind. Rein theoretisch ist nur das letzte gui aktiv wenn ich das Main Gui im Vordergrund hab. Dann wollte ich, wenn alle inaktiv sind, eine Pause Funktion einbauen. Sozusagen wären nur denn alle nicht aktiv wenn ich irgendwas anderes im Vordergrun hab.
Dies klappt aber irgendwie nicht weil an bestimmten zeitpunkten garkein Fenster aktiv ist weder im Spiel noch sonst irgendwo und sowas dürfte doch eigentlich garnicht funktionieren. Das passiert direkt wärend des Spielens und wenn man da eine Pause funktion einbaut hört das Spiel halt beim spielen auf.
Falls da irgendjemand ein Fehler im Script sieht welcher damit zusammen hängt oder eine hübsche Lösung parat hat würde ich mich über diese freuhen
das mit den überprüfen fängt in Zeile 733 an
Spoiler anzeigen
#include <Guiconstants.au3>
#include <Misc.au3>
opt("GUIOnEventMode", 0)
Global $PosP = 280, $JumpU, $JumpL, $JumpR, $Int, $Diffi = 1, $SpeA, $SpeB
;Check Files
#cs
$1 = FileExists(@ScriptDir & "\Graphics\Menue\Intro\Leftd.bmp")
$2 = FileExists(@ScriptDir & "\Graphics\Menue\Intro\Tree.bmp")
$3 = FileExists(@ScriptDir & "\Graphics\Menue\Intro\Rightd.bmp")
$4 = FileExists(@ScriptDir & "\Graphics\Menue\Intro\Mirage.bmp")
$5 = FileExists(@ScriptDir & "\Graphics\Menue\Buttons\Exit.bmp")
$6 = FileExists(@ScriptDir & "\Graphics\Menue\Buttons\Settings.bmp")
$7 = FileExists(@ScriptDir & "\Graphics\Menue\Buttons\Start.bmp")
Select
Case $1 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Intro\Leftd.bmp missed!")
Exit
Case $2 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Intro\Tree.bmp missed!")
Exit
Case $3 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Intro\Rightd.bmp missed!")
Exit
Case $4 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Intro\Mirage.bmp missed!")
Exit
Case $5 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Buttons\Exit.bmp missed!")
Exit
Case $6 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Buttons\Settings.bmp missed!")
Exit
Case $7 = 0
MsgBox(0,"Error",@ScriptDir & "\Graphics\Menue\Buttons\Start.bmp missed!")
Exit
EndSelect
#ce
$Main = Guicreate("Apple Catcher",601,600,@DesktopWidth / 2 - 300,@DesktopHeight / 2 - 300)
GUISetOnEvent(-3,"_Exit")
$LeftD = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Intro\Leftd.gif",-300,222,300,379)
$LeftT = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Intro\Tree.gif",-300,0,300,221)
$RightD = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Intro\Rightd.gif",600,0,300,550)
$RightN = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Intro\Mirage.gif",600,550,97,50)
$ExitB = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Buttons\Exit.bmp",110,600,177,40)
GUICtrlSetOnEvent($ExitB,"_Exit")
$SetupB = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Buttons\Settings.bmp",110,600,177,40)
GUICtrlSetOnEvent($SetupB,"_Setting")
$StartB = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Buttons\Start.bmp",110,600,177,40)
GUICtrlSetOnEvent($StartB,"_Start")
$HighScoreB = GUICtrlCreatePic(@ScriptDir & "\Graphics\Menue\Buttons\HighScore.bmp",300,600,146,20)
;GUICtrlSetOnEvent
$Counter = GUICtrlCreateLabel("3",260,450,80,40)
GUICtrlSetBkColor($Counter, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Counter,30,400,0,"GrungeTastik")
GUICtrlSetState($Counter,$GUI_HIDE)
$Count = GUICtrlCreateLabel("10",540,40,80,40)
GUICtrlSetBkColor($Count, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetState($Count,$GUI_HIDE)
GUICtrlSetFont($Count,30,400,0,"GrungeTastik")
$PlayerGui = GUICreate("Player1", 111,75, 280, 525,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$Main)
$Player = GUICtrlCreatePic(@ScriptDir & "\Graphics\Ingame\guy12.gif",0,0,0,0)
$PlayerGui2 = GUICreate("Player2", 111,75, 280, 525,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$Main)
$Player2 = GUICtrlCreatePic(@ScriptDir & "\Graphics\Ingame\guy22.gif",0,0,0,0)
$ExitGui = GUICreate("Quit Apple Catcher",250,150,@DesktopWidth / 2 - 125,@DesktopHeight / 2 - 75)
$ExitYes = GUICtrlCreateButton("Yes",50,110,40,20)
$SettingGui = GUICreate("Apple Catcher Settings",600,600,@DesktopWidth / 2 - 300,@DesktopHeight / 2 - 300)
$SettingControlL = GUICtrlCreateLabel("Controls",50,100,70,20)
GUICtrlSetFont($SettingControlL,12,1000,4)
$SettingControls = GUICtrlCreateLabel("Move Left: Arrow Key Left" & @CRLF & @CRLF & @CRLF & "Move Right: Arrow Key Right" & @CRLF & @CRLF & @CRLF & "Jump Up: Arrow Key Up" & @CRLF & @CRLF & @CRLF & "Jump Left: Arrow Key Left + Space" & @CRLF & @CRLF & @CRLF & "Jump Right: Arrow Key Right + Space"& @CRLF & @CRLF & @CRLF & "Pause On: Page Up"& @CRLF & @CRLF & @CRLF &"Pause Off: Page Down" & @CRLF & @CRLF & @CRLF & "Exit Game: Escape or Window Close Button",50,160,290,330)
$SettingDifficultyL = GUICtrlCreateLabel("Difficulty",400,100,70,20)
$DifficultyPeeL = GUICtrlCreateLabel("PeetheBee",400,160,70,20)
$DifficultyEasyL = GUICtrlCreateLabel("Easy",400,200,40,20)
$DifficultyMediumL = GUICtrlCreateLabel("Medium",400,240,50,20)
$DifficultyHardL = GUICtrlCreateLabel("Hard",400,280,40,20)
$DifficultyHardCL = GUICtrlCreateLabel("Titan",400,320,50,20)
$DPeeSet = GUICtrlCreateRadio("",470,160,20,20)
$DEasySet = GUICtrlCreateRadio("",470,200,20,20)
$DMediumSet = GUICtrlCreateRadio("",470,240,20,20)
$DHardSet = GUICtrlCreateRadio("",470,280,20,20)
$DTitanSet = GUICtrlCreateRadio("",470,320,20,20)
GUICtrlSetOnEvent($DEasySet,"_Diff1")
GUICtrlSetOnEvent($DMediumSet,"_Diff2")
GUICtrlSetOnEvent($DHardSet,"_Diff3")
GUICtrlSetOnEvent($DTitanSet,"_Diff4")
GUICtrlSetOnEvent($DPeeSet,"_Diff0")
GUICtrlSetState($DEasySet,$GUI_CHECKED)
$DifficultyBack = GUICtrlCreateButton("Back",460,550,70,20)
GUICtrlSetOnEvent($DifficultyBack,"_BackMain")
GUICtrlSetFont($DifficultyEasyL,9,600)
GUICtrlSetFont($DifficultyMediumL,9,600)
GUICtrlSetFont($DifficultyHardL,9,600)
GUICtrlSetFont($DifficultyHardCL,9,600)
GUICtrlSetFont($DifficultyPeeL,9,600)
GUICtrlSetFont($SettingDifficultyL,12,1000,4)
GUICtrlSetFont($SettingControls,9)
GUISetBkColor(0x0080FF,$SettingGui)
GUISetBkColor(0x0080FF,$ExitGui)
GUISetBkColor(0x0080FF,$Main)
GUISetState(@SW_HIDE,$PlayerGui)
GUISetState(@SW_HIDE,$PlayerGui2)
GUISetState(@SW_SHOW,$Main)
;Functions Start
_Intro()
Func _Intro()
$B = 5
For $i = 1 to 60
Sleep(5)
ControlMove($Main,"",$LeftD,-300 + $B,222,300,379)
ControlMove($Main,"",$RightD,600 - $B,0,300,550)
ControlMove($Main,"",$LeftT,-300 + $B,0,300,221)
ControlMove($Main,"",$RightN,803 - $B,550,97,50)
$B = $B + 5
Next
$B = 5
Sleep(1000)
For $i = 1 to 60
Sleep(5)
ControlMove($Main,"",$LeftD,0 - $B,222,300,379)
ControlMove($Main,"",$RightD,300 + $B,0,300,550)
$B = $B + 5
Next
$B = 5
Sleep(300)
For $i = 1 to 70
Sleep(0.5)
ControlMove($Main,"",$StartB,110,600 - $B,177,40)
$B = $B + 5
Next
$B = 5
Sleep(200)
For $i = 1 to 50
Sleep(0.5)
ControlMove($Main,"",$SetupB,110,600 - $B,177,40)
$B = $B + 5
Next
$B = 5
Sleep(200)
For $i = 1 to 30
Sleep(0.5)
ControlMove($Main,"",$ExitB,110,600 - $B,177,40)
$B = $B + 5
Next
$B = 5
Sleep(200)
For $i = 1 to 48
Sleep(0.5)
ControlMove($Main,"",$HighScoreB,330,600 - $B,146,20)
$B = $B + 5
Next
GUICtrlDelete($LeftD)
GUICtrlDelete($RightD)
;Intro End
opt("GUIOnEventMode", 1)
EndFunc
Func _BackMain()
GUISetState(@SW_HIDE,$SettingGui)
GUISetState(@SW_SHOW,$Main)
EndFunc
Func _Diff0()
$Diffi = 0
EndFunc
Func _Diff1()
$Diffi = 1
EndFunc
Func _Diff2()
$Diffi = 2
EndFunc
Func _Diff3()
$Diffi = 3
EndFunc
Func _Diff4()
$Diffi = 4
EndFunc
Func _Exit()
Local $Msgbox
$MsgBox = MsgBox(4,"End game","Do u want end Apple Catcher?")
If $MsgBox = 6 Then
Exit
Else
EndIf
EndFunc
Func _Setting()
GUISetState(@SW_HIDE,$Main)
GUISetState(@SW_SHOW,$SettingGui)
EndFunc
Func _Pause()
While 1
If _IsPressed("22") Then ExitLoop
If _IsPressed("1B") Then
$Msgbox = MsgBox(4,"End Current game","Do u want end current game?")
If $Msgbox = 6 Then
Exit
Else
EndIf
EndIf
WEnd
EndFunc
Func _Jumper()
Local $A = -8,$P = 0
For $i = 1 to 20
$JumpU[0][$i] = $A
If $i = 10 Then
$A = + 8
EndIf
Next
For $i = 1 to 10
$JumpL[0][$i] = -8
$JumpL[1][$i] = -5
$JumpR[0][$i] = -8
$JumpR[1][$i] = +5
Next
For $i = 11 to 15
$JumpL[0][$i] = -2
$JumpL[1][$i] = -5
$JumpR[0][$i] = -2
$JumpR[1][$i] = +5
Next
For $i = 16 to 20
$JumpL[0][$i] = +2
$JumpL[1][$i] = -5
$JumpR[0][$i] = +2
$JumpR[1][$i] = +5
Next
For $i = 21 to 30
$JumpL[0][$i] = +8
$JumpL[1][$i] = -5
$JumpR[0][$i] = +8
$JumpR[1][$i] = +5
Next
For $i = 1 to 7
$Int[0][$i] = $P + 2
$P = $P + 2
Next
$P = 0
For $i = 8 to 15
$Int[0][$i] = $P + 2
$P = $P + 2
Next
EndFunc
Func _Start()
Opt("GuiOnEventMode",0)
Select
Case $Diffi = 0
$SpeA = 1
$SpeB = 1
Case $Diffi = 1
$SpeA = 1
$SpeB = 3
Case $Diffi = 2
$SpeA = 3
$SpeB = 5
Case $Diffi = 3
$SpeA = 5
$SpeB = 7
Case $Diffi = 4
$SpeA = 10
$SpeB = 12
EndSelect
Local $A, $B
GUICtrlSetState($StartB,$GUI_HIDE)
GUICtrlSetState($SetupB,$GUI_HIDE)
GUICtrlSetState($ExitB,$GUI_HIDE)
GUICtrlSetState($RightN,$GUI_HIDE)
GUICtrlSetState($Count,$GUI_SHOW)
GUICtrlSetState($LeftT,$GUI_DISABLE)
$A = 5
$B = 3.68333
For $i = 1 to 20
ControlMove($Main,"",$LeftT,0,0,300 + $A,221 + $B)
Sleep(1)
$A = $A + 15
$B = $B + 3.68333 * 3
GUICtrlSetState($LeftT,$GUI_SHOW)
Next
GUISetState(@SW_SHOW,$PlayerGui)
_Game()
Endfunc
Func _Game()
;~ Prepare / initializing start
Dim $Ret[2][5], $Apple[2][5], $Place[2][5], $Posi[2][5],$Speed[2][5], $Side[2][2], $JumpU[1][22], $JumpL[2][32], $JumpR[2][32], $Int[1][16]
Local $Points = 10, $Range = 0, $JumpUp = 0, $JumpLeft = 0, $JumpRight = 0, $SideNr = 0, $Top = 526, $JD = 0, $JDL = 0, $JDR = 0, $ArrNr = 1, $ArrNrL = 1, $ArrNrR = 1, $CartS = 537, $Q = 1, $NOJ = 0, $QC = 0
$Side[0][0] = +1
$Side[0][1] = -51
$Side[1][0] = -60
$Side[1][1] = -111
For $i = 0 to 4
;$Ret[0][$i] = 24
$Apple[0][$i] = "×"
;$Ret[1][$i] = 24
$Apple[1][$i] = "×"
Next
GUICtrlSetState($Counter,$GUI_SHOW)
Sleep(1000)
GUICtrlSetData($Counter,"2")
Sleep(1000)
GUICtrlSetData($Counter,"1")
Sleep(1000)
GUICtrlSetData($Counter,"GO")
Sleep(300)
GUICtrlDelete($Counter)
_Jumper()
$TimerStart = TimerInit()
;~ Prepare / initializing end
;~ Start Game Loop
For $i = 1 to 500000
If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
;~ Create droping apples start
$RanP = Random(1,50,1)
If $RanP = 5 Then
For $i = 0 to 4
If $Apple[0][$i] = "×" Then
$Pos = WinGetPos($Main)
$RanS = Random(50,500)
$Apple[0][$i] = GUICreate("AppleR" & $i,24,24,$RanS,0,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$Main)
GUICtrlCreatePic(@ScriptDir & "\Graphics\Ingame\RApple.gif",0,0,0,0)
GUISetState(@SW_SHOW,$Apple[0][$i])
$Place[0][$i] = $RanS
$Speed[0][$i] = Random($SpeA,$SpeB,1)
ExitLoop
Else
EndIf
Next
EndIf
$RanP = Random(1,50,1)
If $RanP = 5 Then
For $i = 0 to 2
If $Apple[1][$i] = "×" Then
$Pos = WinGetPos($Main)
$RanS = Random(50,500)
$Apple[1][$i] = GUICreate("AppleG" & $i,24,24,$RanS,0,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$Main)
GUICtrlCreatePic(@ScriptDir & "\Graphics\Ingame\GApple.gif",0,0,0,0)
GUISetState(@SW_SHOW,$Apple[1][$i])
$Place[1][$i] = $RanS
$Speed[1][$i] = Random($SpeA,$SpeB,1)
ExitLoop
Else
EndIf
Next
EndIf
;~ Create droping apples stop
;~ Start check keyprints
If $JD = 0 And $JDL = 0 And $JDR = 0 Then
$Pos = WinGetPos($PlayerGui)
Select
Case _IsPressed("20")
If _IsPressed("25") Then
$JumpLeft = 1
ElseIf _IsPressed("27") Then
$JumpRight = 1
Else
$JumpUp = 1
EndIf
Case _IsPressed("25")
If $PosP = 0 Then
Else
GUISetState(@SW_HIDE,$PlayerGui2)
GUISetState(@SW_SHOW,$PlayerGui)
WinMove($PlayerGui,"",$Pos[0] - 10,$Pos[1],111,75)
WinMove($PlayerGui2,"",$Pos[0] - 10,$Pos[1],111,75)
$PosP = $PosP - 10
$SideNr = 0
EndIf
Case _IsPressed("27")
If $PosP = 490 Then
Else
GUISetState(@SW_HIDE,$PlayerGui)
GUISetState(@SW_SHOW,$PlayerGui2)
WinMove($PlayerGui,"",$Pos[0] + 10,$Pos[1],111,75)
WinMove($PlayerGui2,"",$Pos[0] + 10,$Pos[1],111,75)
$PosP = $PosP + 10
$SideNr = 1
EndIf
Case _IsPressed("1B")
$MsgBox = MsgBox(4,"End Game","Do u want end current game?")
If $Msgbox = 6 Then
Exit
Else
EndIf
Case _IsPressed("21")
_Pause()
EndSelect
Else
EndIf
;~ EndIf
;~ Stop check keyprints
;If $JD = 1 Then
;~ Move down apples
For $i = 0 to 4
If $Apple[0][$i] = "×" Then
Else
$Pos = WinGetPos($Apple[0][$i])
WinMove($Apple[0][$i],"",$Pos[0],$Pos[1] + $Speed[0][$i],24,24)
$Ret[0][$i] = $Ret[0][$i] + $Speed[0][$i]
EndIf
If $Apple[1][$i] = "×" Then
Else
$Pos2 = WinGetPos($Apple[1][$i])
WinMove($Apple[1][$i],"",$Pos2[0],$Pos2[1] + $Speed[1][$i],24,24)
$Ret[1][$i] = $Ret[1][$i] + $Speed[1][$i]
EndIf
Next
;~ end moving
;~ Jump keys
If $JumpUp = 1 Then
$JD = 1
$Pos = WinGetPos($PlayerGui)
$CartS = $CartS + $JumpU[0][$ArrNr]
$Top = $Top + $JumpU[0][$ArrNr]
WinMove($PlayerGui,"",$Pos[0],$Pos[1] + $JumpU[0][$ArrNr],111,75)
WinMove($PlayerGui2,"",$Pos[0],$Pos[1] + $JumpU[0][$ArrNr],111,75)
$ArrNr = $ArrNr + 1
If $ArrNr = 21 then
$CartS = 537
;~ WinMove($PlayerGui,$Pos[0],$Pos[1],111,75)
;~ WinMove($PlayerGui2,$Pos[0],$Pos[1],111,75)
$JumpUp = 0
$JD = 0
$ArrNr = 0
EndIf
EndIf
If $JumpLeft = 1 Then
$JDL = 1
Select
Case $PosP = 0 And $ArrNrL = 1
$QC = 16
;~ #cs
Case $PosP = 0 And $ArrNrL = 3
$QQ = 2
$QC = 1
Case $PosP = 0 And $ArrNrL = 5
$QQ = 4
$QC = 2
Case $PosP = 0 And $ArrNrL = 7
$QQ = 6
$QC = 3
Case $PosP = 0 And $ArrNrL = 9
$QQ = 8
$QC = 4
Case $PosP = 0 And $ArrNrL = 11
$QQ = 10
$QC = 5
Case $PosP = 0 And $ArrNrL = 13
$QQ = 12
$QC = 6
Case $PosP = 0 And $ArrNrL = 15
$QQ = 14
$QC = 7
Case $PosP = 0 And $ArrNrL = 17
$QQ = 14
$QC = 14
Case $PosP = 0 And $ArrNrL = 19
$QQ = 12
$QC = 13
Case $PosP = 0 And $ArrNrL = 21
$QQ = 10
$QC = 12
Case $PosP = 0 And $ArrNrL = 23
$QQ = 8
$QC = 11
Case $PosP = 0 And $ArrNrL = 25
$QQ = 6
$QC = 10
Case $PosP = 0 And $ArrNrL = 27
$QQ = 4
$QC = 9
Case $PosP = 0 And $ArrNrL = 29
$QQ = 2
$QC = 8
EndSelect
$Pos = WinGetPos($PlayerGui)
Select
Case $QC = 0
$Carts = $Carts + $JumpL[0][$ArrNrL]
$PosP = $PosP + $JumpL[1][$ArrNrL]
$Top = $Top + $JumpL[0][$ArrNrL]
WinMove($PlayerGui,"",$Pos[0] + $JumpL[1][$ArrNrL],$Pos[1] + $JumpL[0][$ArrNrL],111,75)
WinMove($PlayerGui2,"",$Pos[0] + $JumpL[1][$ArrNrL],$Pos[1] + $JumpL[0][$ArrNrL],111,75)
$ArrNrL = $ArrNrL + 1
If $ArrNrL = 31 Then
$Carts = 537
$JumpLeft = 0
$JDL = 0
$ArrNrL = 0
EndIf
Case $QC = 16
$Carts = 537
$JumpLeft = 0
$JDL = 0
$ArrNrL = 0
$QC = 0
Case $QC = 1 Or $QC = 2 Or $Qc = 3 Or $Qc = 4 Or $Qc = 5 Or $Qc = 6 Or $Qc = 7 Or $Qc = 8 Or $Qc = 9 Or $Qc = 10 Or $Qc = 11 Or $Qc = 12 Or $Qc = 13 Or $Qc = 14 Or $Qc = 15
$Carts = $Carts - $JumpL[0][$Int[0][$QC]]
$Top = $Top - $JumpL[0][$Int[0][$QC]]
WinMove($PlayerGui,"",$Pos[0],$Pos[1] - $JumpL[0][$Int[0][$QC]],111,75)
WinMove($PlayerGui2,"",$Pos[0],$Pos[1] - $JumpL[0][$Int[0][$QC]],111,75)
$Int[0][$Qc] = $Int[0][$Qc] - 1
If $Int[0][$Qc] = 0 Then
$Int[0][$Qc] = $QQ
$Carts = 537
$JumpLeft = 0
$JDL = 0
$ArrNrL = 0
$QC = 0
EndIf
EndSelect
EndIf
If $JumpRight = 1 Then
$JDR = 1
Select
Case $PosP = 490 And $ArrNrR = 1
$QC = 16
;~ #cs
Case $PosP = 490 And $ArrNrR = 3
$QQ = 2
$QC = 1
Case $PosP = 490 And $ArrNrR = 5
$QQ = 4
$QC = 2
Case $PosP = 490 And $ArrNrR = 7
$QQ = 6
$QC = 3
Case $PosP = 490 And $ArrNrR = 9
$QQ = 8
$QC = 4
Case $PosP = 490 And $ArrNrR = 11
$QQ = 10
$QC = 5
Case $PosP = 490 And $ArrNrR = 13
$QQ = 12
$QC = 6
Case $PosP = 490 And $ArrNrR = 15
$QQ = 14
$QC = 7
;~ #ce
Case $PosP = 490 And $ArrNrR = 17
$QQ = 14
$QC = 14
;~ #cs
Case $PosP = 490 And $ArrNrR = 19
$QQ = 12
$QC = 13
Case $PosP = 490 And $ArrNrR = 21
$QQ = 10
$QC = 12
Case $PosP = 490 And $ArrNrR = 23
$QQ = 8
$QC = 11
Case $PosP = 490 And $ArrNrR = 25
$QQ = 6
$QC = 10
Case $PosP = 490 And $ArrNrR = 27
$QQ = 4
$QC = 9
Case $PosP = 490 And $ArrNrR = 29
$QQ = 2
$QC = 8
EndSelect
$Pos = WinGetPos($PlayerGui)
Select
Case $QC = 0
$Carts = $Carts + $JumpR[0][$ArrNrR]
$PosP = $PosP + $JumpR[1][$ArrNrR]
$Top = $Top + $JumpR[0][$ArrNrR]
WinMove($PlayerGui,"",$Pos[0] + $JumpR[1][$ArrNrR],$Pos[1] + $JumpR[0][$ArrNrR],111,75)
WinMove($PlayerGui2,"",$Pos[0] + $JumpR[1][$ArrNrR],$Pos[1] + $JumpR[0][$ArrNrR],111,75)
$ArrNrR = $ArrNrR + 1
If $ArrNrR = 31 Then
$Carts = 537
$JumpRight = 0
$JDR = 0
$ArrNrR = 0
EndIf
Case $QC = 16
$Carts = 537
$JumpRight = 0
$JDR = 0
$ArrNrR = 0
$QC = 0
Case $QC = 1 Or $QC = 2 Or $Qc = 3 Or $Qc = 4 Or $Qc = 5 Or $Qc = 6 Or $Qc = 7 Or $Qc = 8 Or $Qc = 9 Or $Qc = 10 Or $Qc = 11 Or $Qc = 12 Or $Qc = 13 Or $Qc = 14 Or $Qc = 15
$Carts = $Carts - $JumpR[0][$Int[0][$QC]]
$Top = $Top - $JumpR[0][$Int[0][$QC]]
WinMove($PlayerGui,"",$Pos[0],$Pos[1] - $JumpR[0][$Int[0][$QC]],111,75)
WinMove($PlayerGui2,"",$Pos[0],$Pos[1] - $JumpR[0][$Int[0][$QC]],111,75)
$Int[0][$Qc] = $Int[0][$Qc] - 1
If $Int[0][$Qc] = 0 Then
$Int[0][$Qc] = $QQ
$Carts = 537
$JumpRight = 0
$JDR = 0
$ArrNrR = 0
$QC = 0
EndIf
EndSelect
EndIf
;~ End jump keys
;~ Check correspond Apple/Player
;#cs
For $i = 0 to 4
If $Apple[0][$i] = "×" Then
Else
$Coord = WinGetPos($Apple[0][$i])
$Coord2 = WinGetPos($PlayerGui)
If $Ret[0][$i] > $CartS And $Ret[0][$i] < $CartS + 23 Then
If $PosP < $Place[0][$i] + $Side[$SideNr][0] And $PosP > $Place[0][$i] + $Side[$SideNr][1] Then
$Points = $Points + 1
GUICtrlSetData($Count,$Points)
GUIDelete($Apple[0][$i])
$Apple[0][$i] = "×"
$Ret[0][$i] = 2.5
$Place[0][$i] = 0
$Posi[0][$i] = 0
Else
EndIf
EndIf
EndIf
Next
For $i = 0 to 2
If $Apple[1][$i] = "×" Then
Else
$Coord = WinGetPos($Apple[1][$i])
$Coord2 = WinGetPos($PlayerGui)
If $Ret[1][$i] > $CartS And $Ret[1][$i] < $Carts + 23 Then
If $PosP < $Place[1][$i] + $Side[$SideNr][0] And $PosP > $Place[1][$i] + $Side[$SideNr][1] Then
$Points = $Points - 2
GUICtrlSetData($Count,$Points)
GUIDelete($Apple[1][$i])
$Apple[1][$i] = "×"
$Ret[1][$i] = 2.5
$Place[1][$i] = 0
$Posi[1][$i] = 0
Else
EndIf
EndIf
EndIf
Next
;#ce
For $i = 0 to 2
If $Apple[1][$i] = "×" Then
Else
;$Pos = WinGetPos($Apple[1][$i])
If $Ret[1][$i] > 576 Then
GUIDelete($Apple[1][$i])
$Apple[1][$i] = "×"
$Ret[1][$i] = 2.5
$Place[1][$i] = 0
$Posi[1][$i] = 0
Else
EndIf
EndIf
Next
For $i = 0 to 4
If $Apple[0][$i] = "×" Then
Else
;$Pos = WinGetPos($Apple[0][$i])
If $Ret[0][$i] > 576 Then
GUIDelete($Apple[0][$i])
$Apple[0][$i] = "×"
$Ret[0][$i] = 2.5
$Place[0][$i] = 0
$Posi[0][$i] = 0
$Points = $Points - 1
GUICtrlSetData($Count,$Points)
Else
EndIf
EndIf
Next
;~ Check End
$Pause = 1
For $i = 0 to 4
If $Apple[0][$i] = "×" Then
Else
$State = WinGetState($Apple[0][$i])
If $State = 15 Then $Pause = 0
If $Apple[1][$i] = "×" Then
Else
$State = WinGetState($Apple[1][$i])
If $State = 15 Then $Pause = 0
EndIf
EndIf
Next
$State = WinGetState($PlayerGui)
If $State = 15 Then $Pause = 0
$State = WinGetState($PlayerGui2)
If $State = 15 Then $Pause = 0
$State = WinGetState($Main)
If $State = 15 Then $Pause = 0
If $Pause = 1 Then
$List = WinList()
For $i = 1 to $List[0][0]
$State = WinGetState($List[$i][0])
If $State = 15 Then
MsgBox(0,"halo",$List[$i][0])
Else
EndIf
Next
EndIf
If TimerDiff($TimerStart) > 119900 and TimerDiff($TimerStart) < 120000 Then
MsgBox(0,"Halo","Erstes lvl geschafft" & $Q)
Return
;ElseIf $Points = 0 Then
; MsgBox(0,"Halo","Leider nich geschafft")
; Return
EndIf
Sleep(30)
Next
EndFunc
While 1
Sleep(1)
WEnd
Alles anzeigen
Mfg Mirage