ich habe mich mal in ner Art Spiel versucht,
wobei mir eine kleine Macke aufgefallen ist.
Die Geschwindigkeit der Schleife bleibt einfach nicht konstant
könnt ihr mir sagen wieso?
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $x2 = 200
Global $x3 = 432
Global $x4 = 560
$y1 = 19
$y2 = 19
$y3 = 19
$Form1 = GUICreate("Form1", 446, 836, 444, 12)
$Button1 = GUICtrlCreateButton("o", 216, 752, 17, 17, 0)
$Button2 = GUICtrlCreateButton("<", 560, 560, 19, 17, 0)
$Button3 = GUICtrlCreateButton(">", 432, 432, 19, 17, 0)
$Button4 = GUICtrlCreateButton("<", 200, 256, 19, 17, 0)
GUISetState(@SW_SHOW)
While 1
Sleep(2)
$x2 = $x2 + 1
$x3 = $x3 + 1
$x4 = $x4 + 1
GUICtrlSetPos($Button2, $y1,$x2)
GUICtrlSetPos($Button3, $y2,$x3)
GUICtrlSetPos($Button4, $y3,$x4)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
If $x2 > 800 then
GUICtrlSetPos($Button2, $y1, 5)
$x2 = 5
$y1 = Random(10,400,50)
EndIf
If $x3 > 800 then
GUICtrlSetPos($Button3, $y2, 5)
$x3 = 5
$y2 = Random(10,400,50)
EndIf
If $x4 > 800 then
GUICtrlSetPos($Button4, $y3, 5)
$x4 = 5
$y3 = random(10,400,50)
EndIf
WEnd
Nicht wundern;
den unteren Button wird man später noch bewegen können,
und die Grafiken liegen bei mir auch schon vor,
ich hab sie allerdings der Einfachheit halber durch Buttons ersetzt,
Also hier geht's nur um's Prinzip.
Danke vorweg
Gruß,
Buckiuxx