Mein erstes Minigame (mit GDI+) NEU: QuickDraw Version

  • Hier ist mein erstes Minigame mit GDI+:

    Spoiler anzeigen
    [autoit]

    #RequireAdmin
    #Region includes
    #include <GDIPlus.au3>
    #include <Misc.au3>
    #include <Sound.au3>
    #EndRegion
    #Region Globale Variablen und Einstellungen
    OnAutoItExitRegister("dispose")
    Opt("GUICloseOnESC", 0)
    Global $xl=25, $yl=70, $xt=70, $yt=25, $xr=460, $yr=70, $xb=70, $yb=460, $score=0, $ballpos[2]=[250, 250], $delaybmove=IniRead("data/config.ini", "Other", "BSpeed", 50), $varx=5, $vary=3, $game=true, $drawbonusmalus=false, $xbonus, $ybonus, $GameBG=IniRead("data/config.ini", "Colors", "Game Background", "0xFF000000"), $pxb=IniRead("data/config.ini", "Other", "pxb", 5)
    Const $vWidth=10, $vHeight=50, $hWidth=50, $hHeight=10, $ly=20, $lx=20, $lwidth=455, $lheight=455
    $hits=StringRegExp(FileRead("data/config.ini"), "(.*)\nKollisionsound=(.*)", 3)
    If IsArray($hits) Then $hits=StringReplace($hits[1], @CR, "")
    $hits=_SoundOpen($hits)
    If @error Then $hits=_SoundOpen("data/sfx/hit.wav")
    #EndRegion
    #Region GDI+
    _GDIPlus_Startup()
    $LeftBrickPen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Left Brick Color", "0xFFFFFFFF"), 4)
    $LeftBrickBrush=_GDIPlus_BrushCreateSolid(IniRead("data/config.ini", "Colors", "Left Brick Color", "0xFFFFFFFF"))
    $TopBrickPen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Top Brick Color", "0xFFFFFFFF"), 4)
    $TopBrickBrush=_GDIPlus_BrushCreateSolid(IniRead("data/config.ini", "Colors", "Top Brick Color", "0xFFFFFFFF"))
    $RightBrickPen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Right Brick Color", "0xFFFFFFFF"), 4)
    $RightBrickBrush=_GDIPlus_BrushCreateSolid(IniRead("data/config.ini", "Colors", "Right Brick Color", "0xFFFFFFFF"))
    $BottomBrickPen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Bottom Brick Color", "0xFFFFFFFF"), 4)
    $BottomBrickBrush=_GDIPlus_BrushCreateSolid(IniRead("data/config.ini", "Colors", "Bottom Brick Color", "0xFFFFFFFF"))
    $LinePen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Line Color", "0xFFFF0000"), 2)
    $sFormat = _GDIPlus_StringFormatCreate()
    $sBrush = _GDIPlus_BrushCreateSolid(0xFFFFFF00)
    $sFamily = _GDIPlus_FontFamilyCreate("Courier New")
    $sFont = _GDIPlus_FontCreate($sFamily, 10)
    $sLayout = _GDIPlus_RectFCreate(5, 5)
    $BallPen=_GDIPlus_PenCreate(IniRead("data/config.ini", "Colors", "Ball Color", 0xFFFFFFFF))
    $BallBrush=_GDIPlus_BrushCreateSolid(IniRead("data/config.ini", "Colors", "Ball Color", 0xFFFFFFFF))
    $bonus=_GDIPlus_ImageLoadFromFile("data/images/bonus.jpg")
    $malus=_GDIPlus_ImageLoadFromFile("data/images/malus.jpg")
    #EndRegion
    While 1
    #Region Hauptmenü
    $sGUI = GUICreate("", 343, 213, -1, -1, 0x80000000+0x00800000)
    GUISetFont(20, 800, 2, "Courier New")
    GUICtrlSetDefColor(IniRead("data\config.ini", "Colors", "FontColor", "0xFFFF00"))
    GUISetBkColor(IniRead("data/config.ini", "Colors", "Menu Background", "0x000000"))
    $start = GUICtrlCreateLabel("Starten", 104, 8, 116, 35)
    $credits = GUICtrlCreateLabel("Credits", 104, 132, 116, 35)
    $exit = GUICtrlCreateLabel("Beenden", 104, 169, 116, 35)
    $options = GUICtrlCreateLabel("Optionen", 104, 89, 140, 35)
    $highscore = GUICtrlCreateLabel("Highscore", 104, 48, 164, 35)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3, $exit
    Exit
    Case $start
    GUIDelete($sGUI)
    ExitLoop
    Case $highscore
    MsgBox(64, "Fehler", "Diese Funktion ist noch nicht verfügbar")
    Case $options
    $oGUI = GUICreate("Optionen", 222, 187, -1, -1, 0x80000000+0x00800000)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(14, 400, 2, "Courier New")
    GUISetBkColor(0x000000)
    $coloro=GUICtrlCreateLabel("Farben", 64, 24, 70, 25)
    $audioo=GUICtrlCreateLabel("Audio", 64, 80, 59, 25)
    $controlo=GUICtrlCreateLabel("Steuerung", 64, 136, 103, 25)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case $coloro
    $cGUI = GUICreate("Farben", 248, 515, 192, 124)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(11, 400, 0, "Courier New")
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Schriftfarbe", 16, 16, 112, 21)
    $choosefontcolor = GUICtrlCreateButton("", 152, 14, 25, 25)
    GUICtrlCreateLabel("Hintergrundfarben:", 16, 64, 166, 21)
    GUICtrlCreateLabel("Startmenü", 64, 96, 85, 21)
    $choosemenubg = GUICtrlCreateButton("", 176, 94, 25, 25)
    GUICtrlCreateLabel("Spiel", 64, 136, 49, 21)
    $choosegamebg = GUICtrlCreateButton("", 176, 134, 25, 25)
    GUICtrlCreateLabel("Brickfarben:", 16, 184, 112, 21)
    GUICtrlCreateLabel("Links", 64, 216, 49, 21)
    $chooseleftbrick = GUICtrlCreateButton("", 176, 214, 25, 25)
    GUICtrlCreateLabel("Oben", 64, 256, 40, 21)
    $choosetopbrick = GUICtrlCreateButton("", 176, 254, 25, 25)
    GUICtrlCreateLabel("Rechts", 64, 296, 58, 21)
    $chooserightbrick = GUICtrlCreateButton("", 176, 294, 25, 25)
    GUICtrlCreateLabel("Unten", 64, 336, 49, 21)
    $choosebottombrick = GUICtrlCreateButton("", 176, 334, 25, 25)
    GUICtrlCreateLabel("Randfarbe", 16, 384, 85, 21)
    $chooselinecolor = GUICtrlCreateButton("", 152, 382, 25, 25)
    GUICtrlCreateLabel("Ballfarbe", 16, 430, 85, 21)
    $chooseballcolor = GUICtrlCreateButton("", 152, 424, 25, 25)
    $save = GUICtrlCreateButton("Speichern", 112, 480, 91, 25)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($cGUI)
    ExitLoop
    Case $choosefontcolor
    $nfontcolor=_ChooseColor(2)
    GUICtrlSetBkColor($choosefontcolor, $nfontcolor)
    Case $choosemenubg
    $nmenubg=_ChooseColor(2)
    GUICtrlSetBkColor($choosemenubg, $nmenubg)
    Case $choosegamebg
    $ngamebg=_ChooseColor(2)
    GUICtrlSetBkColor($choosegamebg, $ngamebg)
    $0x=StringLeft($ngamebg, 2)
    $rgb=StringRight($ngamebg, 6)
    $ngamebg=$0x&"FF"&$rgb
    Case $chooseleftbrick
    $nleftbrick=_ChooseColor(2)
    GUICtrlSetBkColor($chooseleftbrick, $nleftbrick)
    $0x=StringLeft($nleftbrick, 2)
    $rgb=StringRight($nleftbrick, 6)
    $nleftbrick=$0x&"FF"&$rgb
    Case $choosetopbrick
    $ntopbrick=_ChooseColor(2)
    GUICtrlSetBkColor($choosetopbrick, $ntopbrick)
    $0x=StringLeft($ntopbrick, 2)
    $rgb=StringRight($ntopbrick, 6)
    $ntopbrick=$0x&"FF"&$rgb
    Case $chooserightbrick
    $nrightbrick=_ChooseColor(2)
    GUICtrlSetBkColor($chooserightbrick, $nrightbrick)
    $0x=StringLeft($nrightbrick, 2)
    $rgb=StringRight($nrightbrick, 6)
    $nrightbrick=$0x&"FF"&$rgb
    Case $choosebottombrick
    $nbottombrick=_ChooseColor(2)
    GUICtrlSetBkColor($choosebottombrick, $nbottombrick)
    $0x=StringLeft($nbottombrick, 2)
    $rgb=StringRight($nbottombrick, 6)
    $nbottombrick=$0x&"FF"&$rgb
    Case $chooselinecolor
    $nlinecolor=_ChooseColor(2)
    GUICtrlSetBkColor($chooselinecolor, $nlinecolor)
    $0x=StringLeft($nlinecolor, 2)
    $rgb=StringRight($nlinecolor, 6)
    $nlinecolor=$0x&"FF"&$rgb
    Case $chooseballcolor
    $nballcolor=_ChooseColor(2)
    GUICtrlSetBkColor($chooselinecolor, $nballcolor)
    $0x=StringLeft($nballcolor, 2)
    $rgb=StringRight($nballcolor, 6)
    $nballcolor=$0x&"FF"&$rgb
    Case $save
    If IsDeclared("nfontcolor") Then IniWrite("data/config.ini", "Colors", "FontColor", $nfontcolor)
    If IsDeclared("nmenubg") Then IniWrite("data/config.ini", "Colors", "Menu Background", $nmenubg)
    If IsDeclared("ngamebg") Then IniWrite("data/config.ini", "Colors", "Game Background", $ngamebg)
    If IsDeclared("nleftbrick") Then IniWrite("data/config.ini", "Colors", "Left Brick Color", $nleftbrick)
    If IsDeclared("ntopbrick") Then IniWrite("data/config.ini", "Colors", "Top Brick Color", $ntopbrick)
    If IsDeclared("nrightbrick") Then IniWrite("data/config.ini", "Colors", "Right Brick Color", $nrightbrick)
    If IsDeclared("nbottombrick") Then IniWrite("data/config.ini", "Colors", "Bottom Brick Color", $nbottombrick)
    If IsDeclared("nlinecolor") Then IniWrite("data/config.ini", "Colors", "Line Color", $nlinecolor)
    If IsDeclared("nballcolor") Then IniWrite("data/config.ini", "Colors", "Ball Color", $nballcolor)
    GUIDelete($cGUI)
    ExitLoop
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($cGUI)
    ExitLoop
    EndIf
    WEnd
    Case $audioo
    $aGUI = GUICreate("Audio", 342, 175, 192, 124)
    GUISetBkColor(0x000000)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(10, 400, 0, "Courier New")
    GUICtrlCreateLabel("Hintergrundmusik", 16, 16, 132, 20)
    $bgmusic = GUICtrlCreateInput("", 152, 15, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("Sounds:", 16, 48, 60, 20)
    GUICtrlCreateLabel("Kollision", 48, 80, 76, 20)
    $kollisionsound = GUICtrlCreateInput("", 152, 79, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("Ende", 48, 112, 36, 20)
    $endsound = GUICtrlCreateInput("", 152, 111, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    $searchbgm = GUICtrlCreateButton("...", 288, 13, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $searchsk = GUICtrlCreateButton("...", 288, 77, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $searchse = GUICtrlCreateButton("...", 288, 109, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $save = GUICtrlCreateButton("Speichern", 56, 144, 75, 25)
    GUICtrlSetColor(-1, 0x000000)
    $standard = GUICtrlCreateButton("Standart", 152, 144, 75, 25)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($aGUI)
    ExitLoop
    Case $searchbgm
    GUICtrlSetData($bgmusic, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $searchsk
    GUICtrlSetData($kollisionsound, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $searchse
    GUICtrlSetData($endsound, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $save
    If GUICtrlRead($bgmusic)<>"" Then
    If IniRead("data/config.ini", "Audio", "Background Music", "") ="" Then IniWrite("data/config.ini", "Audio", "Background Music", "")
    $bgm=StringRegExpReplace(FileRead("data/config.ini"), "Background Music=.*", "Background Music="&GUICtrlRead($bgmusic))
    FileWrite("data/config.ini", $bgm)
    EndIf
    If GUICtrlRead($kollisionsound)<>"" Then
    If IniRead("data/config.ini", "Audio", "Kollisionsound", "") ="" Then IniWrite("data/config.ini", "Audio", "Kollisionsound", "")
    $kss=StringRegExpReplace(FileRead("data/config.ini"), "Kollisionsound=.*", "Kollisionsound="&GUICtrlRead($kollisionsound))
    FileWrite("data/config.ini", $kss)
    EndIf
    If GUICtrlRead($endsound)<>"" Then
    If IniRead("data/config.ini", "Audio", "End", "") ="" Then IniWrite("data/config.ini", "Audio", "End", "")
    $ends=StringRegExpReplace(FileRead("data/config.ini"), "End=.*", "End="&GUICtrlRead($endsound))
    FileWrite("data/config.ini", $ends)
    EndIf
    GUIDelete($aGUI)
    ExitLoop
    Case $standard
    IniDelete("data/config.ini", "Audio")
    GUIDelete($aGUI)
    ExitLoop
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($aGUI)
    ExitLoop
    EndIf
    WEnd
    Case $controlo
    $cGUI = GUICreate("Steuerung", 341, 605, 192, 124)
    GUISetFont(10, 400, 0, "Courier New")
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Geschwindigkeit vom Ball", 24, 16, 196, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $bspeed = GUICtrlCreateInput(IniRead("data/config.ini", "Other", "BSpeed", "50"), 256, 14, 41, 24, 0x2000)
    $Ud1 = GUICtrlCreateUpdown($bspeed)
    GUICtrlSetLimit($bspeed, 2)
    GUICtrlSetLimit($ud1, 99)
    GUICtrlCreateLabel("Pixelbewegung vom Brick", 24, 56, 188, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $pxp = GUICtrlCreateInput(IniRead("data/config.ini", "Other", "pxb", "5"), 256, 54, 41, 24, 0x2000)
    $Ud2 = GUICtrlCreateUpdown($pxp)
    GUICtrlSetLimit($pxp, 2)
    GUICtrlSetLimit($ud2, 20)
    GUICtrlCreateLabel("Linker Brick", 24, 96, 100, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hklt = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkltn", "W"), 96, 128, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hklb = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hklbn", "S"), 96, 152, 284, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Oberer Brick", 24, 192, 100, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hktl = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hktln", "A"), 96, 232, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hktr = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hktrn", "D"), 96, 264, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Rechter Brick", 24, 312, 108, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkrt = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkrtn", "Up Arrow"), 88, 352, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkrb = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkrbn", "Down Arrow"), 88, 392, 316, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Unterer Block", 24, 440, 108, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkul = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkuln", "Left Arrow"), 88, 480, 308, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkur = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkurn", "Right Arrow"), 88, 520, 316, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $Save = GUICtrlCreateButton("Speichern", 40, 568, 75, 25)
    $standard = GUICtrlCreateButton("Standart", 192, 568, 75, 25)
    GUISetState(@SW_SHOW)
    Local $hotkeylt, $hotkeylb, $hotkeytl, $hotkeytr, $hotkeyrt, $hotkeyrb, $hotkeyur, $hotkeyul
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($cGUI)
    ExitLoop
    Case $save
    IniWrite("data/config.ini", "Other", "BSpeed", GUICtrlRead($bspeed))
    IniWrite("data/config.ini", "Other", "pxb", GUICtrlRead($pxp))
    If IsArray($hotkeylt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkltn", $hotkeylt[2])
    If IsArray($hotkeylt) Then IniWrite("data/config.ini", "Tastenbelegung", "hklt", $hotkeylt[0])
    If IsArray($hotkeylb) Then IniWrite("data/config.ini", "Tastenbelegung", "hklbn", $hotkeylb[2])
    If IsArray($hotkeylb) Then IniWrite("data/config.ini", "Tastenbelegung", "hklb", $hotkeylb[0])
    If IsArray($hotkeytl) Then IniWrite("data/config.ini", "Tastenbelegung", "hktln", $hotkeytl[2])
    If IsArray($hotkeytl) Then IniWrite("data/config.ini", "Tastenbelegung", "hktl", $hotkeytl[0])
    If IsArray($hotkeytr) Then IniWrite("data/config.ini", "Tastenbelegung", "hktrn", $hotkeytr[2])
    If IsArray($hotkeytr) Then IniWrite("data/config.ini", "Tastenbelegung", "hktr", $hotkeytr[0])
    If IsArray($hotkeyrt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrtn", $hotkeyrt[2])
    If IsArray($hotkeyrt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrt", $hotkeyrt[0])
    If IsArray($hotkeyrb) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrbn", $hotkeyrb[2])
    If IsArray($hotkeyrb) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrb", $hotkeyrb[0])
    If IsArray($hotkeyur) Then IniWrite("data/config.ini", "Tastenbelegung", "hkurn", $hotkeyur[2])
    If IsArray($hotkeyur) Then IniWrite("data/config.ini", "Tastenbelegung", "hkur", $hotkeyur[0])
    If IsArray($hotkeyul) Then IniWrite("data/config.ini", "Tastenbelegung", "hkuln", $hotkeyul[2])
    If IsArray($hotkeyul) Then IniWrite("data/config.ini", "Tastenbelegung", "hkul", $hotkeyul[0])
    GUIDelete($cGUI)
    ExitLoop
    Case $standard
    IniDelete("data/config.ini", "Other")
    IniDelete("data/config.ini", "Tastenbelegung")
    Case $hklt
    GUICtrlSetData($hklt, "Taste drücken...")
    GUICtrlSetState($hklt, 256)
    While sleep(10)
    $hotkeylt=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hklt, $hotkeylt[2])
    Case $hklb
    GUICtrlSetData($hklb, "Taste drücken...")
    GUICtrlSetState($hklb, 256)
    While sleep(10)
    $hotkeylb=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hklb, $hotkeylb[2])
    Case $hktl
    GUICtrlSetData($hktl, "Taste drücken...")
    GUICtrlSetState($hktl, 256)
    While sleep(10)
    $hotkeytl=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hktl, $hotkeytl[2])
    Case $hktr
    GUICtrlSetData($hktr, "Taste drücken...")
    GUICtrlSetState($hktr, 256)
    While sleep(10)
    $hotkeytr=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hktr, $hotkeytr[2])
    Case $hkrt
    GUICtrlSetData($hkrt, "Taste drücken...")
    GUICtrlSetState($hkrt, 256)
    While sleep(10)
    $hotkeyrt=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkrt, $hotkeyrt[2])
    Case $hkrb
    GUICtrlSetData($hkrb, "Taste drücken...")
    GUICtrlSetState($hkrb, 256)
    While sleep(10)
    $hotkeyrb=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkrb, $hotkeyrb[2])
    Case $hkur
    GUICtrlSetData($hkur, "Taste drücken...")
    GUICtrlSetState($hkur, 256)
    While sleep(10)
    $hotkeyur=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkur, $hotkeyur[2])
    Case $hkul
    GUICtrlSetData($hkul, "Taste drücken...")
    GUICtrlSetState($hkul, 256)
    While sleep(10)
    $hotkeyul=GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkul, $hotkeyul[2])
    EndSwitch
    If GUICtrlRead($pxp)>20 Then GUICtrlSetData($pxp, 20)
    WEnd
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($oGUI)
    ExitLoop
    EndIf
    WEnd
    Case $credits
    MsgBox(64, "Fehler", "Diese Funktion ist noch nicht verfügbar")
    EndSwitch
    WEnd
    #EndRegion
    #Region GameGUI
    $game=true
    If IniRead("data/config.ini", "Audio", "Background Music", "") <>"" Then
    $bgmpath=StringRegExp(FileRead("data/config.ini"), "(.*)\nBackground Music=(.*)", 3)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($bgmpath) Then $bgmpath=StringReplace($bgmpath[1], @CR, "")
    $musictime=_SoundLength($bgmpath, 2)
    Else
    $musictime=100000000000000
    EndIf
    $hGUI = GUICreate("Minigame", 500, 500, -1, -1, 0x80000000+0x00800000)
    GUISetBkColor(0x000000)
    $hGraphics=_GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap=_GDIPlus_BitmapCreateFromGraphics(500, 500, $hGraphics)
    $hBuffer=_GDIPlus_ImageGetGraphicsContext($hBitmap)
    GUISetState()
    drawblocks()
    drawball()
    _GDIPlus_GraphicsDrawRect($hBuffer, $lx, $ly, $lWidth, $lHeight, $LinePen)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, "Score: "&$score, $sFont, $sLayout, $sFormat, $sBrush)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, 500, 500)
    $Randomtime=Random(30000, 50000, 1)
    $moveballtimer=TimerInit()
    $scoretimer=TimerInit()
    $handletimer=TimerInit()
    $musicpos=TimerInit()
    $timeout=""
    _SoundPlay($bgmpath)
    Local $lt=IniRead("data/config.ini", "Tastenbelegung", "hklt", 57), $lb=IniRead("data/config.ini", "Tastenbelegung", "hklb", 53), $tl=IniRead("data/config.ini", "Tastenbelegung", "hktl", 41), $tr=IniRead("data/config.ini", "Tastenbelegung", "hktr", 44)
    Local $rt=IniRead("data/config.ini", "Tastenbelegung", "hkrt", 26), $rb=IniRead("data/config.ini", "Tastenbelegung", "hkrb", 28), $ur=IniRead("data/config.ini", "Tastenbelegung", "hkur", 27), $ul=IniRead("data/config.ini", "Tastenbelegung", "hkul", 25)

    [/autoit] [autoit][/autoit] [autoit]

    While $game=true
    Switch GUIGetMsg()
    Case -3
    ExitLoop
    EndSwitch
    If _IsPressed("1B") Then ExitLoop
    If _IsPressed($ul) And $xb>25 Then moveblock(4, "l")
    If _IsPressed($ur) And $xb<420 Then moveblock(4, "r")
    If _IsPressed($rt) And $yr>25 Then moveblock(3, "u")
    If _IsPressed($rb) And $yr<420 Then moveblock(3, "d")
    If _IsPressed($tl) And $xt>25 Then moveblock(2, "l")
    If _IsPressed($tr) And $xt<420 Then moveblock(2, "r")
    If _IsPressed($lt) And $yl>25 Then moveblock(1, "u")
    If _IsPressed($lb) And $yl<420 Then moveblock(1, "d")
    If NOT WinActive("Minigame") Then
    Do
    sleep(100)
    Until WinActive("Minigame")
    drawblocks()
    drawball()
    _GDIPlus_GraphicsDrawRect($hBuffer, $lx, $ly, $lWidth, $lHeight, $LinePen)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, "Score: "&$score, $sFont, $sLayout, $sFormat, $sBrush)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, 500, 500)
    EndIf
    If TimerDiff($moveballtimer)>=$delaybmove Then
    moveball()
    $moveballtimer=TimerInit()
    EndIf
    If TimerDiff($scoretimer)>=10000 Then
    $score+=150
    $scoretimer=TimerInit()
    EndIf
    If TimerDiff($handletimer)>=$Randomtime And $drawbonusmalus=false Then
    $type=Random(1, 2, 1)
    If $type=1 Then $handle=$bonus
    If $type=2 Then $handle=$malus
    $Randomtime=Random(30000, 50000, 1)
    $handletimer=TimerInit()
    createrandombonus(Random(50, 430, 1), Random(50, 430, 1))
    $timeout=TimerInit()
    EndIf
    If _RectCollision($xbonus, $yBonus, 20, 20, $ballpos[0], $ballpos[1], 25, 25) And $drawbonusmalus Then
    $Randomtime=Random(30000, 50000, 1)
    $handletimer=TimerInit()
    $drawbonusmalus=False
    If $type=1 Then $score+=Random(50, 500, 1)
    If $type=2 And $score>0 Then $score-=Random(50, 500, 1)
    EndIf
    If TimerDiff($timeout)>=20000 And $drawbonusmalus Then $drawbonusmalus=false
    If TimerDiff($musicpos)>=$musictime+3000 Then
    _SoundPlay($bgmpath)
    $musicpos=TimerInit()
    EndIf
    WEnd
    #EndRegion
    $score=0
    $drawbonusmalus=false
    GUIDelete($hGUI)
    $ballpos[0]=250
    $ballpos[1]=250
    $soundpath=InIRead("data/config.ini", "Audio", "Background Music", "")
    _SoundStop($bgmpath)
    WEnd
    #Region Funktionen
    #Region Zeichnen
    Func createrandombonus($handlex, $handley)
    $xbonus=$handlex
    $ybonus=$handley
    $drawbonusmalus=true
    _GDIPlus_GraphicsDrawImage($hGraphics, $handle, $handlex, $handley)
    EndFunc
    Func drawblocks()
    _GDIPlus_GraphicsClear($hBuffer, $GameBG)
    _GDIPlus_GraphicsDrawRect($hBuffer, $xl, $yl, $vwidth, $vheight, $LeftBrickPen)
    _GDIPlus_GraphicsFillRect($hBuffer, $xl, $yl, $vwidth, $vheight, $LeftBrickBrush)
    _GDIPlus_GraphicsDrawRect($hBuffer, $xt, $yt, $hwidth, $hheight, $TopBrickPen)
    _GDIPlus_GraphicsFillRect($hBuffer, $xt, $yt, $hwidth, $hheight, $TopBrickBrush)
    _GDIPlus_GraphicsDrawRect($hBuffer, $xr, $yr, $vwidth, $vheight, $RightBrickPen)
    _GDIPlus_GraphicsFillRect($hBuffer, $xr, $yr, $vwidth, $vheight, $RightBrickBrush)
    _GDIPlus_GraphicsDrawRect($hBuffer, $xb, $yb, $hwidth, $hheight, $BottomBrickPen)
    _GDIPlus_GraphicsFillRect($hBuffer, $xb, $yb, $hwidth, $hheight, $BottomBrickBrush)
    EndFunc
    Func drawball()
    _GDIPlus_GraphicsDrawEllipse($hBuffer, $ballpos[0], $ballpos[1], 20, 20, $BallPen)
    _GDIPlus_GraphicsFillEllipse($hBuffer, $ballpos[0], $ballpos[1], 20, 20, $BallBrush)
    EndFunc
    #EndRegion
    #Region Bewegungen
    Func moveblock($block, $direction)
    Switch $block
    Case 1
    If $direction="u" Then $yl-=$pxb
    If $direction="d" Then $yl+=$pxb
    Case 2
    If $direction="l" Then $xt-=$pxb
    If $direction="r" Then $xt+=$pxb
    Case 3
    If $direction="u" Then $yr-=$pxb
    If $direction="d" Then $yr+=$pxb
    Case 4
    If $direction="l" Then $xb-=$pxb
    If $direction="r" Then $xb+=$pxb
    EndSwitch
    drawblocks()
    drawball()
    _GDIPlus_GraphicsDrawRect($hBuffer, $lx, $ly, $lWidth, $lHeight, $LinePen)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, "Score: "&$score, $sFont, $sLayout, $sFormat, $sBrush)
    If $drawbonusmalus Then _GDIPlus_GraphicsDrawImage($hBuffer, $handle, $xBonus, $yBonus)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, 500, 500)
    _GDIPlus_GraphicsClear($hBuffer, $GameBG)
    EndFunc
    Func moveball()
    If $ballpos[1]>=460 Or $ballpos[1]<=10 Then kill()
    If $ballpos[0]>=460 Or $ballpos[0]<=10 Then kill()
    If _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xl, $yl, 15, 50) Then
    $varx = $varx * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xr-10, $yr, 10, 50) Then
    $varx = $varx * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xt, $yt, 50, 15) Then
    $vary = $vary * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xb, $yb-6, 50, 10) Then
    $vary = $vary * (-1)
    _SoundPlay($hits)
    EndIf
    $ballpos[0]+=$varx
    $ballpos[1]+=$vary
    drawblocks()
    drawball()
    _GDIPlus_GraphicsDrawRect($hBuffer, $lx, $ly, $lWidth, $lHeight, $LinePen)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, "Score: "&$score, $sFont, $sLayout, $sFormat, $sBrush)
    If $drawbonusmalus Then _GDIPlus_GraphicsDrawImage($hBuffer, $handle, $xBonus, $yBonus)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, 500, 500)
    _GDIPlus_GraphicsClear($hBuffer, $GameBG)
    EndFunc
    #EndRegion
    Func kill()
    SoundPlay(IniRead("data/config.ini", "Audio", "End", "data/sfx/loose.wav"))
    MsgBox(64, "Verloren", "Du hast mit "&$score&" Punkten verloren")
    $game=false
    EndFunc
    Func dispose()
    _GDIPlus_FontDispose($sFont)
    _GDIPlus_FontFamilyDispose($sFamily)
    _GDIPlus_StringFormatDispose($sFormat)
    _GDIPlus_BrushDispose($sBrush)
    _GDIPlus_BrushDispose($BallBrush)
    _GDIPlus_BrushDispose($LeftBrickBrush)
    _GDIPlus_BrushDispose($TopBrickBrush)
    _GDIPlus_BrushDispose($RightBrickBrush)
    _GDIPlus_BrushDispose($BottomBrickBrush)
    _GDIPlus_PenDispose($LeftBrickPen)
    _GDIPlus_PenDispose($TopBrickPen)
    _GDIPlus_PenDispose($RightBrickPen)
    _GDIPlus_PenDispose($BottomBrickPen)
    _GDIPlus_PenDispose($BallPen)
    _GDIPlus_PenDispose($LinePen)
    If IsDeclared("hGraphics") Then
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    EndIf
    _GDIPlus_Shutdown()
    _SoundClose($hits)
    EndFunc
    #EndRegion
    Func _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    ;Author: Faweyr
    Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2
    EndFunc ;==>_RectCollision
    ; Autor: Faweyr
    ; Function: GetKeyInput($sTime,$sBack)
    ; Parameter: $sTime = Time to wait and check for pressed Keys
    ; $sBack = the kind of Result
    ; 0 = Array[3] = ["_ispressed"-Code , "Send"-Code , Name of Key]
    ; 1 = "_ispressed"-Code
    ; 2 = "Send"-Code
    ; 3 = Name of Key
    ; Includes: <Misc.au3>
    func GetKeyInput($sTime = 5000,$sBack = 0)
    $sTimer = TimerInit()
    $sDll = DllOpen("user32.dll")
    Local $sList[111][3] = [ [08,"{BACKSPACE}","Backspace"], [09,"{TAB}","Tab"], [0&"D","{ENTER}","Enter"], ["A"&0,"{LSHIFT}","Left Shift"], ["A"&1,"{RSHIFT}","Right Shift"], _
    [13,"{Pause}","Pause"], [14,"{CAPSLOCK}","Caps Lock"], [1&"B","{ESC}","Esc"], [20,"{SPACE}","Spacebar"], [21,"{PGUP}","Page Up"], [22,"{PGDN}","Page Down"], [23,"{End}","End"], _
    [24,"{Home}","Home"], [25,"{Left}","Left Arrow"], [26,"{UP}","Up Arrow"], [27,"{Right}","Right Arrow"], [28,"{Down}","Down Arrow"], [12,"{ALT}","Alt"], [5&"C","{RWIN}","Right Windows"], _
    [2&"C","{PRINTSCREEN}","Print Screen"], [2&"D","{INS}","Ins"], [2&"E","{DELETE}","Del"], [30,0,"0"], [31,1,"1"], [32,2,"2"], _
    [33,3,"3"], [34,4,"4"], [35,5,"5"], [36,6,"6"], [37,7,"7"], [38,8,"8"], [39,9,"9"], _
    [41,"a","A"], [42,"b","B"], [43,"c","C"], [44,"d","D"], [45,"e","E"], [46,"f","F"], [47,"g","G"], _
    [48,"h","H"], [49,"i","I"], [4&"A","j","J"], [4&"B","k","K"], [4&"C","l","L"], [4&"D","m","M"], [4&"E","n","N"], _
    [4&"F","o","O"], [50,"p","P"], [51,"q","Q"], [52,"r","R"], [53,"s","S"], [54,"t","T"], [55,"u","U"], _
    [56,"v","V"], [57,"w","W"], [58,"x","X"], [59,"y","Y"], [5&"A","z","Z"], [60,"{NUMPAD0}","Keypad 0"], [61,"{NUMPAD1}","Keypad 1"], _
    [62,"{NUMPAD2}","Keypad 2"],[63,"{NUMPAD3}","Keypad 3"], [64,"{NUMPAD4}","Keypad 4"], [65,"{NUMPAD5}","Keypad 5"], [66,"{NUMPAD6}","Keypad 6"], [67,"{NUMPAD7}","Keypad 7"], [68,"{NUMPAD8}","Keypad 8"], _
    [69,"{NUMPAD9}","Keypad 9"],[6&"A","{NUMPADMULT}","Multiply"], [6&"B","{NUMPADADD}","Add"], [6&"C","{NUMPADENTER}","Separator"],[6&"D","{NUMPADSUB}","Subtract"], [6&"E","{NUMPADDOT}","Decimal"], [6&"F","{NUMPADDIV}","Divide"], _
    [70,"{F1}","F1"], [71,"{F2}","F2"], [72,"{F3}","F3"], [73,"{F4}","F4"], [74,"{F5}","F5"], [75,"{F6}","F6"], [76,"{F8}","F7"], _
    [77,"{F8}","F8"], [78,"{F9}","F9"], [79,"{F10}","F10"], [7&"A","{F11}","F11"], [7&"B","{F12}","F12"], [90,"{NUMLOCK}","Num Lock"], [91,"{SCROLLLOCK}","Scroll Lock"], _
    ["A"&2,"{LCTRL}","Left Control"], ["A"&3,"{RCTRL}","Right Control"], ["A"&4,"{LALT}","Left Menu"], ["A"&5,"{RALT}","Right Menu"], [5&"B","{LWIN}","Left Windows"] ]

    [/autoit] [autoit][/autoit] [autoit]

    do
    for $i = 0 to UBound($sList)-1 step 1
    If _IsPressed($sList[$i][0], $sDll) then
    DllClose($sDll)
    If $sBack <> 0 then
    Return $sList[$i][$sBack-1]
    else
    Local $sResult[3] = [$sList[$i][0],$sList[$i][1],$sList[$i][2]]
    Return $sResult
    endif
    endif
    Next
    until $sTime <= TimerDiff($sTimer)
    DllClose($sDll)
    SetError(1)
    EndFunc

    [/autoit]


    -Alle 10 Sekunden wird die Score um 150 erhöht.
    - Durch den Block, wo 100 draufsteht kann man 100 Punkte erhalten. Durch den Bonus Block bekommt man eine zufällige Punktzahl zwischen 50 und 500 dazu
    - Durch den Malus Block bekommt man eine zufällige Punktzahl zwischen 25 und 250 abgezogen
    - Nach 20 Sekunden verschwindet der block, wenn er nicht eingesammelt wurde
    Die Grafik ist mit im Anhang

    Steuerung:

    • Linker Block: S | W
      Oberer Block: A | S
      Rechter Block: Pfeiltaste nach oben | Pfeiltaste nach unten
      Unterer Block: Pfeiltaste nach links | Pfeiltaste nach rechts

    ToDo:

    Spoiler anzeigen

    • Items
    • Highscore

    Bug's:

    Spoiler anzeigen
    • Seitliche-/Eckkollision wird nicht erkannt


    NEU: QuickDraw Version
    Vielen Dank an moritz1243 für die QuickDraw UDF und DLL
    Es gibt jetzt sowohl eine GDI+, als auch eine QuickDraw Version.
    Das Zip Archiv im Anhang enthält alle benötigten Dateien.
    Source:

    Spoiler anzeigen
    [autoit]

    #RequireAdmin
    #AutoIt3Wrapper_usex64=n
    #region includes
    #include <GUIListView.au3>
    #include <Array.au3>
    #include "QuickDraw.au3"
    #include <Sound.au3>
    #include <Misc.au3>
    #endregion includes
    #region Globale Variablen und Einstellungen
    OnAutoItExitRegister("_exit")
    Opt("GUICloseOnESC", 0)
    Global $handle, $h[5], $sh[5], $xl = 25, $yl = 70, $xt = 70, $yt = 25, $xr = 460, $yr = 70, $xb = 70, $yb = 460, $score = 0, $ballpos[2] = [250, 250], $delaybmove = IniRead("data/config.ini", "Other", "BSpeed", 50), $varx = 5, $vary = 3, $game = True, $drawbonusmalus = False, $xbonus, $ybonus, $GameBG = IniRead("data/config.ini", "Colors", "Game Background", "0xFF000000"), $pxb = IniRead("data/config.ini", "Other", "pxb", 5)
    Const $vWidth = 10, $vHeight = 50, $hWidth = 50, $hHeight = 10, $ly = 20, $lx = 20, $lwidth = 455, $lheight = 455
    $hits = StringRegExp(FileRead("data/config.ini"), "(.*)\nKollisionsound=(.*)", 3)
    If IsArray($hits) Then $hits = StringReplace($hits[1], @CR, "")
    $hits = _SoundOpen($hits)
    If @error Then $hits = _SoundOpen("data/sfx/hit.wav")
    #endregion Globale Variablen und Einstellungen
    #region Farben
    $LeftBrickBrush = IniRead("data/config.ini", "Colors", "Left Brick Color", "0xFFFFFFFF")
    $TopBrickBrush = IniRead("data/config.ini", "Colors", "Top Brick Color", "0xFFFFFFFF")
    $RightBrickBrush = IniRead("data/config.ini", "Colors", "Right Brick Color", "0xFFFFFFFF")
    $BottomBrickBrush = IniRead("data/config.ini", "Colors", "Bottom Brick Color", "0xFFFFFFFF")
    $BallBrush = IniRead("data/config.ini", "Colors", "Ball Color", "0xFFFFFFFF")
    $LinePen = IniRead("data/config.ini", "Colors", "Line Color", "0xFFFF0000")
    #endregion Farben
    While 1
    #region Hauptmenü
    $sGUI = GUICreate("", 343, 213, -1, -1, 0x80000000 + 0x00800000)
    GUISetFont(20, 800, 2, "Courier New")
    GUICtrlSetDefColor(IniRead("data\config.ini", "Colors", "FontColor", "0xFFFF00"))
    GUISetBkColor(IniRead("data/config.ini", "Colors", "Menu Background", "0x000000"))
    $start = GUICtrlCreateLabel("Starten", 104, 8, 116, 35)
    $credits = GUICtrlCreateLabel("Credits", 104, 132, 116, 35)
    $exit = GUICtrlCreateLabel("Beenden", 104, 169, 116, 35)
    $options = GUICtrlCreateLabel("Optionen", 104, 89, 140, 35)
    $highscore = GUICtrlCreateLabel("Highscore", 104, 48, 164, 35)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3, $exit
    Exit
    Case $start
    GUIDelete($sGUI)
    ExitLoop
    Case $highscore
    $shGUI = GUICreate("Highscores", 625, 443, 192, 124)
    $hListView = GUICtrlCreateListView("Name|Punkte|Datum", 30, 30, 355, 400)
    _GUICtrlListView_SetColumnWidth(GUICtrlGetHandle($hListView), 0, 200)
    _GUICtrlListView_SetColumnWidth(GUICtrlGetHandle($hListView), 1, 70)
    _GUICtrlListView_SetColumnWidth(GUICtrlGetHandle($hListView), 2, 80)
    For $i = 0 To 4
    $h[$i] = StringSplit(IniRead("data/highscore.dat", "Highscore", "Highscore" & $i, "||"), "|")
    Next
    _ArrayDisplay($h[0])
    If $h[0][2] > $h[1][2] And $h[0][2] > $h[2][2] And $h[0][2] > $h[3][2] And $h[0][2] > $h[4][2] Then $sh[0] = IniRead("data/highscore.dat", "Highscore", "Highscore0", "")
    If $h[1][2] > $h[0][2] And $h[1][2] > $h[2][2] And $h[1][2] > $h[3][2] And $h[1][2] > $h[4][2] Then $sh[0] = IniRead("data/highscore.dat", "Highscore", "Highscore1", "")

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To 4
    GUICtrlCreateListViewItem($sh[$i], $hListView)
    Next
    GUISetBkColor(0x000000)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3
    Exit
    EndSwitch
    WEnd
    Case $options
    $oGUI = GUICreate("Optionen", 222, 187, -1, -1, 0x80000000 + 0x00800000)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(14, 400, 2, "Courier New")
    GUISetBkColor(0x000000)
    $coloro = GUICtrlCreateLabel("Farben", 64, 24, 70, 25)
    $audioo = GUICtrlCreateLabel("Audio", 64, 80, 59, 25)
    $controlo = GUICtrlCreateLabel("Steuerung", 64, 136, 103, 25)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case $coloro
    $cGUI = GUICreate("Farben", 248, 515, 192, 124)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(11, 400, 0, "Courier New")
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Schriftfarbe", 16, 16, 112, 21)
    $choosefontcolor = GUICtrlCreateButton("", 152, 14, 25, 25)
    GUICtrlCreateLabel("Hintergrundfarben:", 16, 64, 166, 21)
    GUICtrlCreateLabel("Startmenü", 64, 96, 85, 21)
    $choosemenubg = GUICtrlCreateButton("", 176, 94, 25, 25)
    GUICtrlCreateLabel("Spiel", 64, 136, 49, 21)
    $choosegamebg = GUICtrlCreateButton("", 176, 134, 25, 25)
    GUICtrlCreateLabel("Brickfarben:", 16, 184, 112, 21)
    GUICtrlCreateLabel("Links", 64, 216, 49, 21)
    $chooseleftbrick = GUICtrlCreateButton("", 176, 214, 25, 25)
    GUICtrlCreateLabel("Oben", 64, 256, 40, 21)
    $choosetopbrick = GUICtrlCreateButton("", 176, 254, 25, 25)
    GUICtrlCreateLabel("Rechts", 64, 296, 58, 21)
    $chooserightbrick = GUICtrlCreateButton("", 176, 294, 25, 25)
    GUICtrlCreateLabel("Unten", 64, 336, 49, 21)
    $choosebottombrick = GUICtrlCreateButton("", 176, 334, 25, 25)
    GUICtrlCreateLabel("Randfarbe", 16, 384, 85, 21)
    $chooselinecolor = GUICtrlCreateButton("", 152, 382, 25, 25)
    GUICtrlCreateLabel("Ballfarbe", 16, 430, 85, 21)
    $chooseballcolor = GUICtrlCreateButton("", 152, 424, 25, 25)
    $save = GUICtrlCreateButton("Speichern", 112, 480, 91, 25)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($cGUI)
    ExitLoop
    Case $choosefontcolor
    $nfontcolor = _ChooseColor(2)
    GUICtrlSetBkColor($choosefontcolor, $nfontcolor)
    Case $choosemenubg
    $nmenubg = _ChooseColor(2)
    GUICtrlSetBkColor($choosemenubg, $nmenubg)
    Case $choosegamebg
    $ngamebg = _ChooseColor(2)
    GUICtrlSetBkColor($choosegamebg, $ngamebg)
    $0x = StringLeft($ngamebg, 2)
    $rgb = StringRight($ngamebg, 6)
    $ngamebg = $0x & "FF" & $rgb
    Case $chooseleftbrick
    $nleftbrick = _ChooseColor(2)
    GUICtrlSetBkColor($chooseleftbrick, $nleftbrick)
    $0x = StringLeft($nleftbrick, 2)
    $rgb = StringRight($nleftbrick, 6)
    $nleftbrick = $0x & "FF" & $rgb
    Case $choosetopbrick
    $ntopbrick = _ChooseColor(2)
    GUICtrlSetBkColor($choosetopbrick, $ntopbrick)
    $0x = StringLeft($ntopbrick, 2)
    $rgb = StringRight($ntopbrick, 6)
    $ntopbrick = $0x & "FF" & $rgb
    Case $chooserightbrick
    $nrightbrick = _ChooseColor(2)
    GUICtrlSetBkColor($chooserightbrick, $nrightbrick)
    $0x = StringLeft($nrightbrick, 2)
    $rgb = StringRight($nrightbrick, 6)
    $nrightbrick = $0x & "FF" & $rgb
    Case $choosebottombrick
    $nbottombrick = _ChooseColor(2)
    GUICtrlSetBkColor($choosebottombrick, $nbottombrick)
    $0x = StringLeft($nbottombrick, 2)
    $rgb = StringRight($nbottombrick, 6)
    $nbottombrick = $0x & "FF" & $rgb
    Case $chooselinecolor
    $nlinecolor = _ChooseColor(2)
    GUICtrlSetBkColor($chooselinecolor, $nlinecolor)
    $0x = StringLeft($nlinecolor, 2)
    $rgb = StringRight($nlinecolor, 6)
    $nlinecolor = $0x & "FF" & $rgb
    Case $chooseballcolor
    $nballcolor = _ChooseColor(2)
    GUICtrlSetBkColor($chooselinecolor, $nballcolor)
    $0x = StringLeft($nballcolor, 2)
    $rgb = StringRight($nballcolor, 6)
    $nballcolor = $0x & "FF" & $rgb
    Case $save
    If IsDeclared("nfontcolor") Then IniWrite("data/config.ini", "Colors", "FontColor", $nfontcolor)
    If IsDeclared("nmenubg") Then IniWrite("data/config.ini", "Colors", "Menu Background", $nmenubg)
    If IsDeclared("ngamebg") Then IniWrite("data/config.ini", "Colors", "Game Background", $ngamebg)
    If IsDeclared("nleftbrick") Then IniWrite("data/config.ini", "Colors", "Left Brick Color", $nleftbrick)
    If IsDeclared("ntopbrick") Then IniWrite("data/config.ini", "Colors", "Top Brick Color", $ntopbrick)
    If IsDeclared("nrightbrick") Then IniWrite("data/config.ini", "Colors", "Right Brick Color", $nrightbrick)
    If IsDeclared("nbottombrick") Then IniWrite("data/config.ini", "Colors", "Bottom Brick Color", $nbottombrick)
    If IsDeclared("nlinecolor") Then IniWrite("data/config.ini", "Colors", "Line Color", $nlinecolor)
    If IsDeclared("nballcolor") Then IniWrite("data/config.ini", "Colors", "Ball Color", $nballcolor)
    GUIDelete($cGUI)
    ExitLoop
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($cGUI)
    ExitLoop
    EndIf
    WEnd
    Case $audioo
    $aGUI = GUICreate("Audio", 342, 175, 192, 124)
    GUISetBkColor(0x000000)
    GUICtrlSetDefColor(0xFFFF00)
    GUISetFont(10, 400, 0, "Courier New")
    GUICtrlCreateLabel("Hintergrundmusik", 16, 16, 132, 20)
    $bgmusic = GUICtrlCreateInput("", 152, 15, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("Sounds:", 16, 48, 60, 20)
    GUICtrlCreateLabel("Kollision", 48, 80, 76, 20)
    $kollisionsound = GUICtrlCreateInput("", 152, 79, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("Ende", 48, 112, 36, 20)
    $endsound = GUICtrlCreateInput("", 152, 111, 121, 21)
    GUICtrlSetColor(-1, 0x000000)
    $searchbgm = GUICtrlCreateButton("...", 288, 13, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $searchsk = GUICtrlCreateButton("...", 288, 77, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $searchse = GUICtrlCreateButton("...", 288, 109, 35, 25)
    GUICtrlSetColor(-1, 0x000000)
    $save = GUICtrlCreateButton("Speichern", 56, 144, 75, 25)
    GUICtrlSetColor(-1, 0x000000)
    $standard = GUICtrlCreateButton("Standart", 152, 144, 75, 25)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($aGUI)
    ExitLoop
    Case $searchbgm
    GUICtrlSetData($bgmusic, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $searchsk
    GUICtrlSetData($kollisionsound, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $searchse
    GUICtrlSetData($endsound, FileOpenDialog("Datei auswählen", Default, "Musikdateien (*.mp3;*.wav)"))
    Case $save
    If GUICtrlRead($bgmusic) <> "" Then
    If IniRead("data/config.ini", "Audio", "Background Music", "") = "" Then IniWrite("data/config.ini", "Audio", "Background Music", "")
    $bgm = StringRegExpReplace(FileRead("data/config.ini"), "Background Music=.*", "Background Music=" & GUICtrlRead($bgmusic))
    FileWrite("data/config.ini", $bgm)
    EndIf
    If GUICtrlRead($kollisionsound) <> "" Then
    If IniRead("data/config.ini", "Audio", "Kollisionsound", "") = "" Then IniWrite("data/config.ini", "Audio", "Kollisionsound", "")
    $kss = StringRegExpReplace(FileRead("data/config.ini"), "Kollisionsound=.*", "Kollisionsound=" & GUICtrlRead($kollisionsound))
    FileWrite("data/config.ini", $kss)
    EndIf
    If GUICtrlRead($endsound) <> "" Then
    If IniRead("data/config.ini", "Audio", "End", "") = "" Then IniWrite("data/config.ini", "Audio", "End", "")
    $ends = StringRegExpReplace(FileRead("data/config.ini"), "End=.*", "End=" & GUICtrlRead($endsound))
    FileWrite("data/config.ini", $ends)
    EndIf
    GUIDelete($aGUI)
    ExitLoop
    Case $standard
    IniDelete("data/config.ini", "Audio")
    GUIDelete($aGUI)
    ExitLoop
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($aGUI)
    ExitLoop
    EndIf
    WEnd
    Case $controlo
    $cGUI = GUICreate("Steuerung", 341, 605, 192, 124)
    GUISetFont(10, 400, 0, "Courier New")
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Geschwindigkeit vom Ball", 24, 16, 196, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $bspeed = GUICtrlCreateInput(IniRead("data/config.ini", "Other", "BSpeed", "50"), 256, 14, 41, 24, 0x2000)
    $Ud1 = GUICtrlCreateUpdown($bspeed)
    GUICtrlSetLimit($bspeed, 2)
    GUICtrlSetLimit($Ud1, 99)
    GUICtrlCreateLabel("Pixelbewegung vom Brick", 24, 56, 188, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $pxp = GUICtrlCreateInput(IniRead("data/config.ini", "Other", "pxb", "5"), 256, 54, 41, 24, 0x2000)
    $Ud2 = GUICtrlCreateUpdown($pxp)
    GUICtrlSetLimit($pxp, 2)
    GUICtrlSetLimit($Ud2, 20)
    GUICtrlCreateLabel("Linker Brick", 24, 96, 100, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hklt = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkltn", "W"), 96, 128, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hklb = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hklbn", "S"), 96, 152, 284, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Oberer Brick", 24, 192, 100, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hktl = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hktln", "A"), 96, 232, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hktr = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hktrn", "D"), 96, 264, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Rechter Brick", 24, 312, 108, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkrt = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkrtn", "Up Arrow"), 88, 352, 300, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkrb = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkrbn", "Down Arrow"), 88, 392, 316, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    GUICtrlCreateLabel("Unterer Block", 24, 440, 108, 20)
    GUICtrlSetFont(-1, 10, 400, 4, "Courier New")
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkul = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkuln", "Left Arrow"), 88, 480, 308, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $hkur = GUICtrlCreateLabel(IniRead("data/config.ini", "Tastenbelegung", "hkurn", "Right Arrow"), 88, 520, 316, 20)
    GUICtrlSetColor(-1, 0xFFFF00)
    $save = GUICtrlCreateButton("Speichern", 40, 568, 75, 25)
    $standard = GUICtrlCreateButton("Standart", 192, 568, 75, 25)
    GUISetState(@SW_SHOW)
    Local $hotkeylt, $hotkeylb, $hotkeytl, $hotkeytr, $hotkeyrt, $hotkeyrb, $hotkeyur, $hotkeyul
    While 1
    Switch GUIGetMsg()
    Case -3
    GUIDelete($cGUI)
    ExitLoop
    Case $save
    IniWrite("data/config.ini", "Other", "BSpeed", GUICtrlRead($bspeed))
    IniWrite("data/config.ini", "Other", "pxb", GUICtrlRead($pxp))
    If IsArray($hotkeylt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkltn", $hotkeylt[2])
    If IsArray($hotkeylt) Then IniWrite("data/config.ini", "Tastenbelegung", "hklt", $hotkeylt[0])
    If IsArray($hotkeylb) Then IniWrite("data/config.ini", "Tastenbelegung", "hklbn", $hotkeylb[2])
    If IsArray($hotkeylb) Then IniWrite("data/config.ini", "Tastenbelegung", "hklb", $hotkeylb[0])
    If IsArray($hotkeytl) Then IniWrite("data/config.ini", "Tastenbelegung", "hktln", $hotkeytl[2])
    If IsArray($hotkeytl) Then IniWrite("data/config.ini", "Tastenbelegung", "hktl", $hotkeytl[0])
    If IsArray($hotkeytr) Then IniWrite("data/config.ini", "Tastenbelegung", "hktrn", $hotkeytr[2])
    If IsArray($hotkeytr) Then IniWrite("data/config.ini", "Tastenbelegung", "hktr", $hotkeytr[0])
    If IsArray($hotkeyrt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrtn", $hotkeyrt[2])
    If IsArray($hotkeyrt) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrt", $hotkeyrt[0])
    If IsArray($hotkeyrb) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrbn", $hotkeyrb[2])
    If IsArray($hotkeyrb) Then IniWrite("data/config.ini", "Tastenbelegung", "hkrb", $hotkeyrb[0])
    If IsArray($hotkeyur) Then IniWrite("data/config.ini", "Tastenbelegung", "hkurn", $hotkeyur[2])
    If IsArray($hotkeyur) Then IniWrite("data/config.ini", "Tastenbelegung", "hkur", $hotkeyur[0])
    If IsArray($hotkeyul) Then IniWrite("data/config.ini", "Tastenbelegung", "hkuln", $hotkeyul[2])
    If IsArray($hotkeyul) Then IniWrite("data/config.ini", "Tastenbelegung", "hkul", $hotkeyul[0])
    GUIDelete($cGUI)
    ExitLoop
    Case $standard
    IniDelete("data/config.ini", "Other")
    IniDelete("data/config.ini", "Tastenbelegung")
    Case $hklt
    GUICtrlSetData($hklt, "Taste drücken...")
    GUICtrlSetState($hklt, 256)
    While Sleep(10)
    $hotkeylt = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hklt, $hotkeylt[2])
    Case $hklb
    GUICtrlSetData($hklb, "Taste drücken...")
    GUICtrlSetState($hklb, 256)
    While Sleep(10)
    $hotkeylb = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hklb, $hotkeylb[2])
    Case $hktl
    GUICtrlSetData($hktl, "Taste drücken...")
    GUICtrlSetState($hktl, 256)
    While Sleep(10)
    $hotkeytl = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hktl, $hotkeytl[2])
    Case $hktr
    GUICtrlSetData($hktr, "Taste drücken...")
    GUICtrlSetState($hktr, 256)
    While Sleep(10)
    $hotkeytr = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hktr, $hotkeytr[2])
    Case $hkrt
    GUICtrlSetData($hkrt, "Taste drücken...")
    GUICtrlSetState($hkrt, 256)
    While Sleep(10)
    $hotkeyrt = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkrt, $hotkeyrt[2])
    Case $hkrb
    GUICtrlSetData($hkrb, "Taste drücken...")
    GUICtrlSetState($hkrb, 256)
    While Sleep(10)
    $hotkeyrb = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkrb, $hotkeyrb[2])
    Case $hkur
    GUICtrlSetData($hkur, "Taste drücken...")
    GUICtrlSetState($hkur, 256)
    While Sleep(10)
    $hotkeyur = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkur, $hotkeyur[2])
    Case $hkul
    GUICtrlSetData($hkul, "Taste drücken...")
    GUICtrlSetState($hkul, 256)
    While Sleep(10)
    $hotkeyul = GetKeyInput(10000)
    If Not @error Then ExitLoop
    WEnd
    GUICtrlSetData($hkul, $hotkeyul[2])
    EndSwitch
    If GUICtrlRead($pxp) > 20 Then GUICtrlSetData($pxp, 20)
    WEnd
    EndSwitch
    If _IsPressed("1B") Then
    GUIDelete($oGUI)
    ExitLoop
    EndIf
    WEnd
    Case $credits
    MsgBox(64, "Fehler", "Diese Funktion ist noch nicht verfügbar")
    EndSwitch
    WEnd
    #endregion Hauptmenü
    #region GameGUI
    $game = True
    If IniRead("data/config.ini", "Audio", "Background Music", "") <> "" Then
    $bgmpath = StringRegExp(FileRead("data/config.ini"), "(.*)\nBackground Music=(.*)", 3)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($bgmpath) Then $bgmpath = StringReplace($bgmpath[1], @CR, "")
    $musictime = _SoundLength($bgmpath, 2)
    Else
    $musictime = 100000000000000
    $bgmpath = ""
    EndIf
    _QuickDraw_Enable("QuickDraw Test", 500, 500, False)
    _QuickDraw_Rect($lx, $ly, $lwidth, $lheight, $Draw_Line, $LinePen)
    $ptrFont = _QuickDraw_CreateFont("Comic Sans MS")
    _QuickDraw_Text(2, 10, "Score: " & $score, 15, $ptrFont, $Draw_Fill, 0xFFFFFF00)
    $bonus = _QuickDraw_LoadTexture("data/images/bonus.bmp")
    $malus = _QuickDraw_LoadTexture("data/images/malus.bmp")
    $Randomtime = Random(30000, 50000, 1)
    $moveballtimer = TimerInit()
    $scoretimer = TimerInit()
    $handletimer = TimerInit()
    $musicpos = TimerInit()
    $timeout = ""
    _SoundPlay($bgmpath)
    Local $lt = IniRead("data/config.ini", "Tastenbelegung", "hklt", 57), $lb = IniRead("data/config.ini", "Tastenbelegung", "hklb", 53), $tl = IniRead("data/config.ini", "Tastenbelegung", "hktl", 41), $tr = IniRead("data/config.ini", "Tastenbelegung", "hktr", 44)
    Local $rt = IniRead("data/config.ini", "Tastenbelegung", "hkrt", 26), $rb = IniRead("data/config.ini", "Tastenbelegung", "hkrb", 28), $ur = IniRead("data/config.ini", "Tastenbelegung", "hkur", 27), $ul = IniRead("data/config.ini", "Tastenbelegung", "hkul", 25)

    [/autoit] [autoit][/autoit] [autoit]

    While _QuickDraw_Running() And $game = True
    _QuickDraw_ClearBuffer(0xFF000000)
    _QuickDraw_Text(2, 10, "Score: " & $score, 15, $ptrFont, $Draw_Fill, 0xFFFFFF00)
    _QuickDraw_Rect($lx, $ly, $lwidth, $lheight, $Draw_Line, $LinePen)
    drawblocks()
    drawball()
    If $drawbonusmalus Then _QuickDraw_Rect($xbonus, $ybonus, 20, 20, $handle, 0xFFFFFFFF)
    Switch GUIGetMsg()
    Case -3
    ExitLoop
    EndSwitch
    If _IsPressed($ul) And $xb > 25 Then moveblock(4, "l")
    If _IsPressed($ur) And $xb < 420 Then moveblock(4, "r")
    If _IsPressed($rt) And $yr > 25 Then moveblock(3, "u")
    If _IsPressed($rb) And $yr < 420 Then moveblock(3, "d")
    If _IsPressed($tl) And $xt > 25 Then moveblock(2, "l")
    If _IsPressed($tr) And $xt < 420 Then moveblock(2, "r")
    If _IsPressed($lt) And $yl > 25 Then moveblock(1, "u")
    If _IsPressed($lb) And $yl < 420 Then moveblock(1, "d")
    If TimerDiff($moveballtimer) >= $delaybmove Then
    moveball()
    $moveballtimer = TimerInit()
    EndIf
    If TimerDiff($scoretimer) >= 10000 Then
    $score += 150
    $scoretimer = TimerInit()
    EndIf
    If TimerDiff($handletimer) >= $Randomtime And $drawbonusmalus = False Then
    $type = Random(1, 2, 1)
    If $type = 1 Then $handle = $bonus
    If $type = 2 Then $handle = $malus
    $Randomtime = Random(30000, 50000, 1)
    $handletimer = TimerInit()
    createrandombonus(Random(50, 430, 1), Random(50, 430, 1))
    $timeout = TimerInit()
    EndIf
    If _RectCollision($xbonus, $ybonus, 20, 20, $ballpos[0], $ballpos[1], 25, 25) And $drawbonusmalus Then
    $Randomtime = Random(30000, 50000, 1)
    $handletimer = TimerInit()
    $drawbonusmalus = False
    If $type = 1 Then $score += Random(50, 500, 1)
    If $type = 2 And $score > 0 Then $score -= Random(50, 500, 1)
    EndIf
    If TimerDiff($timeout) >= 20000 And $drawbonusmalus Then $drawbonusmalus = False
    If TimerDiff($musicpos) >= $musictime + 3000 Then
    _SoundPlay($bgmpath)
    $musicpos = TimerInit()
    EndIf
    _QuickDraw_SwapBuffers()
    WEnd
    #endregion GameGUI
    $score = 0
    $drawbonusmalus = False
    _exit()
    $ballpos[0] = 250
    $ballpos[1] = 250
    $soundpath = IniRead("data/config.ini", "Audio", "Background Music", "")
    _SoundStop($bgmpath)
    WEnd
    #region Funktionen
    #region Zeichnen
    Func createrandombonus($handlex, $handley)
    $xbonus = $handlex
    $ybonus = $handley
    $drawbonusmalus = True
    _QuickDraw_Rect($handlex, $handley, 20, 20, $handle, 0xFFFFFFFF)
    EndFunc ;==>createrandombonus
    Func drawblocks()
    _QuickDraw_Rect($xl, $yl, $vWidth, $vHeight, $Draw_Fill, $LeftBrickBrush)
    _QuickDraw_Rect($xt, $yt, $hWidth, $hHeight, $Draw_Fill, $TopBrickBrush)
    _QuickDraw_Rect($xr, $yr, $vWidth, $vHeight, $Draw_Fill, $RightBrickBrush)
    _QuickDraw_Rect($xb, $yb, $hWidth, $hHeight, $Draw_Fill, $BottomBrickBrush)
    EndFunc ;==>drawblocks
    Func drawball()
    _QuickDraw_Circle($ballpos[0], $ballpos[1], 10, $Draw_Fill, $BallBrush)
    EndFunc ;==>drawball
    #endregion Zeichnen
    #region Bewegungen
    Func moveblock($block, $direction)
    Switch $block
    Case 1
    If $direction = "u" Then $yl -= $pxb
    If $direction = "d" Then $yl += $pxb
    Case 2
    If $direction = "l" Then $xt -= $pxb
    If $direction = "r" Then $xt += $pxb
    Case 3
    If $direction = "u" Then $yr -= $pxb
    If $direction = "d" Then $yr += $pxb
    Case 4
    If $direction = "l" Then $xb -= $pxb
    If $direction = "r" Then $xb += $pxb
    EndSwitch
    EndFunc ;==>moveblock
    Func moveball()
    If $ballpos[1] >= 460 Or $ballpos[1] <= 10 Then kill()
    If $ballpos[0] >= 460 Or $ballpos[0] <= 10 Then kill()
    If _RectCollision($ballpos[0], $ballpos[1], 10, 10, $xl + 10, $yl, 15, 50) Then
    $varx = $varx * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 10, 10, $xr - 10, $yr, 10, 50) Then
    $varx = $varx * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 10, 10, $xt, $yt + 10, 50, 15) Then
    $vary = $vary * (-1)
    _SoundPlay($hits)
    ElseIf _RectCollision($ballpos[0], $ballpos[1], 10, 10, $xb, $yb - 6, 50, 10) Then
    $vary = $vary * (-1)
    _SoundPlay($hits)
    EndIf
    $ballpos[0] += $varx
    $ballpos[1] += $vary
    EndFunc ;==>moveball
    #endregion Bewegungen
    Func kill()
    SoundPlay(IniRead("data/config.ini", "Audio", "End", "data/sfx/loose.wav"))
    MsgBox(64, "Verloren", "Du hast mit " & $score & " Punkten verloren")
    $game = False
    EndFunc ;==>kill
    Func _exit()
    _QuickDraw_FreeFont($ptrFont)
    _QuickDraw_FreeTexture($bonus)
    _QuickDraw_FreeTexture($malus)
    _QuickDraw_Disable()
    _SoundClose($hits)
    EndFunc ;==>_exit
    #endregion Funktionen
    Func _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    ;Author: Faweyr
    Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2
    EndFunc ;==>_RectCollision
    ; Autor: Faweyr
    ; Function: GetKeyInput($sTime,$sBack)
    ; Parameter: $sTime = Time to wait and check for pressed Keys
    ; $sBack = the kind of Result
    ; 0 = Array[3] = ["_ispressed"-Code , "Send"-Code , Name of Key]
    ; 1 = "_ispressed"-Code
    ; 2 = "Send"-Code
    ; 3 = Name of Key
    ; Includes: <Misc.au3>
    Func GetKeyInput($sTime = 5000, $sBack = 0)
    $sTimer = TimerInit()
    $sDll = DllOpen("user32.dll")
    Local $sList[111][3] = [[08, "{BACKSPACE}", "Backspace"],[09, "{TAB}", "Tab"],[0 & "D", "{ENTER}", "Enter"],["A" & 0, "{LSHIFT}", "Left Shift"],["A" & 1, "{RSHIFT}", "Right Shift"], _
    [13, "{Pause}", "Pause"],[14, "{CAPSLOCK}", "Caps Lock"],[1 & "B", "{ESC}", "Esc"],[20, "{SPACE}", "Spacebar"],[21, "{PGUP}", "Page Up"],[22, "{PGDN}", "Page Down"],[23, "{End}", "End"], _
    [24, "{Home}", "Home"],[25, "{Left}", "Left Arrow"],[26, "{UP}", "Up Arrow"],[27, "{Right}", "Right Arrow"],[28, "{Down}", "Down Arrow"],[12, "{ALT}", "Alt"],[5 & "C", "{RWIN}", "Right Windows"], _
    [2 & "C", "{PRINTSCREEN}", "Print Screen"],[2 & "D", "{INS}", "Ins"],[2 & "E", "{DELETE}", "Del"],[30, 0, "0"],[31, 1, "1"],[32, 2, "2"], _
    [33, 3, "3"],[34, 4, "4"],[35, 5, "5"],[36, 6, "6"],[37, 7, "7"],[38, 8, "8"],[39, 9, "9"], _
    [41, "a", "A"],[42, "b", "B"],[43, "c", "C"],[44, "d", "D"],[45, "e", "E"],[46, "f", "F"],[47, "g", "G"], _
    [48, "h", "H"],[49, "i", "I"],[4 & "A", "j", "J"],[4 & "B", "k", "K"],[4 & "C", "l", "L"],[4 & "D", "m", "M"],[4 & "E", "n", "N"], _
    [4 & "F", "o", "O"],[50, "p", "P"],[51, "q", "Q"],[52, "r", "R"],[53, "s", "S"],[54, "t", "T"],[55, "u", "U"], _
    [56, "v", "V"],[57, "w", "W"],[58, "x", "X"],[59, "y", "Y"],[5 & "A", "z", "Z"],[60, "{NUMPAD0}", "Keypad 0"],[61, "{NUMPAD1}", "Keypad 1"], _
    [62, "{NUMPAD2}", "Keypad 2"],[63, "{NUMPAD3}", "Keypad 3"],[64, "{NUMPAD4}", "Keypad 4"],[65, "{NUMPAD5}", "Keypad 5"],[66, "{NUMPAD6}", "Keypad 6"],[67, "{NUMPAD7}", "Keypad 7"],[68, "{NUMPAD8}", "Keypad 8"], _
    [69, "{NUMPAD9}", "Keypad 9"],[6 & "A", "{NUMPADMULT}", "Multiply"],[6 & "B", "{NUMPADADD}", "Add"],[6 & "C", "{NUMPADENTER}", "Separator"],[6 & "D", "{NUMPADSUB}", "Subtract"],[6 & "E", "{NUMPADDOT}", "Decimal"],[6 & "F", "{NUMPADDIV}", "Divide"], _
    [70, "{F1}", "F1"],[71, "{F2}", "F2"],[72, "{F3}", "F3"],[73, "{F4}", "F4"],[74, "{F5}", "F5"],[75, "{F6}", "F6"],[76, "{F8}", "F7"], _
    [77, "{F8}", "F8"],[78, "{F9}", "F9"],[79, "{F10}", "F10"],[7 & "A", "{F11}", "F11"],[7 & "B", "{F12}", "F12"],[90, "{NUMLOCK}", "Num Lock"],[91, "{SCROLLLOCK}", "Scroll Lock"], _
    ["A" & 2, "{LCTRL}", "Left Control"],["A" & 3, "{RCTRL}", "Right Control"],["A" & 4, "{LALT}", "Left Menu"],["A" & 5, "{RALT}", "Right Menu"],[5 & "B", "{LWIN}", "Left Windows"]]

    [/autoit] [autoit][/autoit] [autoit]

    Do
    For $i = 0 To UBound($sList) - 1 Step 1
    If _IsPressed($sList[$i][0], $sDll) Then
    DllClose($sDll)
    If $sBack <> 0 Then
    Return $sList[$i][$sBack - 1]
    Else
    Local $sResult[3] = [$sList[$i][0], $sList[$i][1], $sList[$i][2]]
    Return $sResult
    EndIf
    EndIf
    Next
    Until $sTime <= TimerDiff($sTimer)
    DllClose($sDll)
    SetError(1)
    EndFunc ;==>GetKeyInput

    [/autoit]


    Die Highscore klappt bei beiden Versionen noch nicht. Gibt da ein paar seltsame Fehler...

  • Schönes game.
    Ich finds ne sehr gut gelungene Ping Pong umsetzung.
    4 Bricks machen mehr spaß als 2 :)
    Jedoch wird eine seitliche- bzw. eckkollision mit einem Brick nicht erkannt.
    MfG. PrideRage

    Meine Projekte:
    ClipBoard Manager (beendet)
    Gutes ClipBoard Verwaltungs Programm mit nützlichen Funktionen.

    HTML Creator (beendet)
    Nützliches Tool um schnell ein eigenes HTML Dokument zu erstellen.

  • Es laggt und der Creditbutton geht nicht. Sonst, naja... Die Farben und so sind langweilig. Mal doch nen BG

  • Schönes game.
    Ich finds ne sehr gut gelungene Ping Pong umsetzung.
    4 Bricks machen mehr spaß als 2 :)
    Jedoch wird eine seitliche- bzw. eckkollision mit einem Brick nicht erkannt.
    MfG. PrideRage


    Werd mal gucken, was ich machen kann.

    Es laggt und der Creditbutton geht nicht. Sonst, naja... Die Farben und so sind langweilig. Mal doch nen BG


    Credits kommen ganz am Ende xD die sind unwichtig.
    Wenn ich Items mit eingefügt hab, mach ich ein Optionsmenu, dort wird man die Farben auswählen können. Evtl. füg ich auch noch hinzu, dass man statt Farben ein Bild nehmen kann.

    Danke für die Kritik

  • Hey gut geworden. :thumbup:

    Aber die Kollisions Funktion ist zml langsam nimm mal Diese hier

    [autoit]

    Func _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    ;Author: Faweyr
    Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2
    EndFunc ;==>_RectCollision

    [/autoit]

    Aber aufpassen diese Arbeitet nicht mit den Rechten Oberen und Unteren Punkten sondern mit Höhe und Breite.

    Deshalb müsste die Kollisonsabfrage so aussehn.

    [autoit]

    If _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xl, $yl, 10, 50) Then $varx = $varx * (-1)
    If _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xr, $yr, 10, 50) Then $varx = $varx * (-1)
    If _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xt, $yt, 0, 10) Then $vary = $vary * (-1)
    If _RectCollision($ballpos[0], $ballpos[1], 20, 20, $xb, $yb, 50, 10) Then $vary = $vary * (-1)

    [/autoit]