Powerball (Snake-ähnlich^^)

  • Hallo zusammen^^ Hier möchte ich euch mein 1. Spiel vorstellen: Powerball
    Fast das Selbe wie Snake, nur: der Ball/Schlange wird nicht länger, sondern schneller :D

    Nur da es mein 1. Spiel ist und ich allgemein eher Kot als Code schreibe, sieht es abartig chaotisch aus -.-
    und ich hab auch noch nicht soo die Erfahrung, weshalb ich viele Sachen umständlich schwer gemacht habe.

    Highscore function, wertet die Beste Highscore mit der neuen aus und zeigt das Ergebnis :)
    Farbauswahl von Bk und Ball.
    Schwierigkeitswahl (je schwerer, desto mehr Punkte)
    Testet es einfach mal und sagt mir was ich besser machen kann :) (bitte sanft, da ich noch nie zuvor etwas derartiges gemacht habe^^)
    Danke im Voraus
    Tim

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Comment=New Game!!!
    #AutoIt3Wrapper_Res_Description=Powerball, a Game with is used wit the KeyPad. Catch the apples!
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=Tim Dellmann®
    #AutoIt3Wrapper_Res_Language=1031
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    FileInstall("green-bg.ico", @TempDir & "green-bg.ico")
    FileInstall( "red-bg.ico", @TempDir & "red-bg.ico")
    FileInstall( "blue-bg.ico", @TempDir & "blue-bg.ico")
    FileInstall( "yellow-bg.ico", @TempDir & "yellow-bg.ico")
    FileInstall("mauer__.ico", @TempDir & "mauer__.ico")
    FileInstall("Apfel__.bmp", @TempDir & "Apfel__.bmp")
    FileInstall("Powerball.ico", @TempDir & "Powerball.ico")
    FileInstall("Highscore.hsc", @TempDir & "Highscore.hsc")
    FileInstall("yellow-snake.ico", @TempDir & "yellow-snake.ico")
    FileInstall("red-snake.ico", @TempDir & "red-snake.ico")
    FileInstall("snake-green.ico", @TempDir & "snake-green.ico")
    FileInstall("blue-snake.ico", @TempDir & "blue-snake.ico")
    #Region ### START Koda GUI section ### Form=
    $Form3 = GUICreate("Settings", 205, 314, 467, 291)
    $Group1 = GUICtrlCreateGroup("BG-Color", 8, 8, 177, 97)
    $greensnake = GUICtrlCreateButton("(Not allowed)", 16, 24, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "green-bg.ico", 0)
    $redsnake = GUICtrlCreateButton("(Not allowed)", 56, 24, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "red-bg.ico", 0)
    $bluesnake = GUICtrlCreateButton("(Not allowed)", 96, 24, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "blue-bg.ico", 0)
    $yellowsnake = GUICtrlCreateButton("(Not allowed)", 136, 24, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "yellow-bg.ico", 0)
    $labelbg = GUICtrlCreateLabel(" ", 16, 72, 160, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Snake-Color", 8, 112, 177, 97)
    $snakegreen = GUICtrlCreateButton("(Not allowed)", 16, 128, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "green-bg.ico", 0)
    $redgreen = GUICtrlCreateButton("(Not allowed)", 56, 128, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "red-bg.ico", 0)
    $bluegreen = GUICtrlCreateButton("(Not allowed)", 96, 128, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "blue-bg.ico", 0)
    $yellowsnakee = GUICtrlCreateButton("(Not allowed)", 136, 128, 36, 41, $BS_ICON)
    GUICtrlSetImage(-1, @TempDir & "yellow-bg.ico", 0)
    $snakelabel = GUICtrlCreateLabel(" ", 16, 176, 160, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $levelcombo = GUICtrlCreateCombo("level", 8, 216, 177, 25)
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|Wahnsinn!")
    $start = GUICtrlCreateButton("Starten", 48, 256, 107, 25, 0)
    GUICtrlSetState($start, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    GUICtrlSetState($start, $GUI_DISABLE)

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

    GUICtrlSetData($labelbg, "Grüner Hintergrund")
    $bg = "0x008000"
    $oldpiece = "green-bg"
    $bgsnake = "blue-snake"
    GUICtrlSetData($snakelabel, "Blaue Schlange")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $greensnake
    GUICtrlSetData($labelbg, "Grüner Hintergrund")
    $bg = "0x008000"
    $oldpiece = "green-bg"
    Case $redsnake
    GUICtrlSetData($labelbg, "Roter Hintergrund")
    $bg = "0xFF0000"
    $oldpiece = "red-bg"
    Case $bluesnake
    GUICtrlSetData($labelbg, "Blauer Hintergrund")
    $bg = "0x0000FF"
    $oldpiece = "blue-bg"
    Case $yellowsnake
    GUICtrlSetData($labelbg, "Gelber Hintergrund")
    $bg = "0xFFFF00"
    $oldpiece = "yellow-bg"
    Case $snakegreen
    GUICtrlSetData($snakelabel, "Grüne Schlange")
    $bgsnake = "snake-green"
    Case $redgreen
    GUICtrlSetData($snakelabel, "Rote Schlange")
    $bgsnake = "red-snake"
    Case $bluegreen
    GUICtrlSetData($snakelabel, "Blaue Schlange")
    $bgsnake = "blue-snake"
    Case $yellowsnakee
    GUICtrlSetData($snakelabel, "Gelbe Schlange")
    $bgsnake = "yellow-snake"
    case $start

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

    GUIDelete()
    ExitLoop
    Case $levelcombo
    $level = GUICtrlRead($levelcombo)

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

    if $level = "level" Then GUICtrlSetState($start, $GUI_DISABLE)
    if $level <> "level" Then GUICtrlSetState($start, $GUI_ENaBLE)

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

    EndSwitch
    WEnd

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

    if $level = "1" Then $speed = 600
    if $level = "2" Then $speed = 550
    if $level = "3" Then $speed = 500
    if $level = "4" Then $speed = 450
    if $level = "5" Then $speed = 400
    if $level = "6" Then $speed = 350
    if $level = "7" Then $speed = 300
    if $level = "8" Then $speed = 250
    if $level = "9" Then $speed = 200
    if $level = "10" Then $speed = 150
    if $level = "Wahnsinn!" then $speed = 1
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $highscore = 0
    $oldhighscore = FileReadLine(@TempDir & "Highscore.hsc")
    $time = 0
    While 1
    $snakerandomleft = Random(64, 736, 1)
    if Mod($snakerandomleft, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $snakerandomtop = Random(64, 680, 1)
    if Mod($snakerandomtop, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $appleleft = Random(64, 736, 1)
    if Mod($appleleft, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $appletop = Random(64, 680, 1)
    if Mod($appletop, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd

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

    HotKeySet("{UP}", "_up")
    HotKeySet("{DOWN}", "_down")
    HotKeySet("{RIGHT}", "_right")
    HotKeySet("{LEFT}", "_left")
    #Region ### START Koda GUI section ### Form=
    $maingui = GUICreate("Powerball - by Tim Dellmann", 1121, 737, 169, 96)
    GUISetBkColor($bg)
    GUISetIcon(@TempDir & "/Powerball.ico")
    $snake = GUICtrlCreateIcon(@TempDir & $bgsnake & ".ico", 0, $snakerandomleft, $snakerandomtop, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
    $apple = GUICtrlCreatePic(@TempDir & "Apfel__.bmp", $appleleft, $appletop, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Icon1 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon39 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 32, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon2 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 64, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon3 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 96, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon4 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 128, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon5 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 160, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon6 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 192, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon7 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 224, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon8 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 256, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon9 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 288, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon10 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 320, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon11 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 352, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon12 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 384, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon13 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 416, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon14 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 448, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon15 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 480, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon16 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 512, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon17 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 544, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon18 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 576, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon19 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 608, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon20 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 640, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon21 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 672, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon22 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 704, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon23 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 736, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon24 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon25 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 32, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon26 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 64, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon27 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 96, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon28 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 128, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon29 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 160, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon30 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 192, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon31 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 224, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon32 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 256, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon33 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 288, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon34 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 320, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon35 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 352, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon36 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 384, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon37 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 416, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon38 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 448, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon40 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 480, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon41 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 512, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon42 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 544, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon43 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 576, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon44 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 608, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon45 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 640, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon46 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 672, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon47 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 704, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon48 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 736, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon49 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 768, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon50 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 800, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon51 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 832, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon52 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 864, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon53 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon54 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 768, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon55 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 800, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon56 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 832, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon57 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 864, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon58 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 896, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon59 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 32, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon60 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 64, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon61 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 96, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon62 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 128, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon63 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 160, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon64 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 192, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon65 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 224, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon66 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 256, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon67 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 288, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon68 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 320, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon69 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 352, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon70 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 384, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon71 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 416, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon72 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 448, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon73 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 480, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon74 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 512, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon75 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 544, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon76 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 32, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon77 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 64, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon78 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 96, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon79 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 128, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon80 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 160, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon81 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 192, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon82 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 224, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon83 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 256, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon84 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 288, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon85 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 320, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon86 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 352, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon87 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 384, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon88 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 416, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon89 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 448, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon90 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 480, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon91 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 512, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon92 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 544, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon94 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 576, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon95 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 608, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon96 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 640, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon97 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 0, 672, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon93 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 928, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon98 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 960, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon99 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 992, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon100 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1024, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon101 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1056, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon102 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 576, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon103 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 608, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon104 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 640, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon105 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 672, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon106 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1088, 704, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon107 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 896, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon108 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 928, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon109 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 960, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon110 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 992, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon111 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1024, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Icon112 = GUICtrlCreateIcon(@TempDir & "mauer__.ico", 0, 1056, 0, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $status = ""

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

    $timer = TimerInit()

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    $nowtime = TimerDiff($timer)

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

    $xtimex = $nowtime / 1000
    $xtimex = Round($xtimex)
    if $xtimex = 200 Then _gameover()
    $tip = ToolTip($xtimex & "/" & 200, MouseGetPos(0), MouseGetPos(1))
    if $status = "down" Then
    for $x = 1 to 16 step 1
    GUICtrlSetPos($snake, $snakerandomleft, $snakerandomtop +$x )

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

    Next
    $snakerandomtop = $snakerandomtop + 16
    EndIf
    If $status = "up" Then
    for $x = 1 to 16 Step 1
    GUICtrlSetPos($snake, $snakerandomleft, $snakerandomtop -$x)
    Next
    $snakerandomtop = $snakerandomtop - 16
    EndIf
    if $status = "left" Then
    for $x = 1 to 16 Step 1
    GUICtrlSetPos($snake, $snakerandomleft -$x, $snakerandomtop)

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

    Next
    $snakerandomleft = $snakerandomleft - 16
    EndIf
    if $status = "right" Then
    for $x = 1 to 16 Step 1
    GUICtrlSetPos($snake, $snakerandomleft +$x, $snakerandomtop)
    Next
    $snakerandomleft = $snakerandomleft + 16
    EndIf
    _walltouch()
    _appletouch()
    Sleep($speed)
    WEnd

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

    Func _down()
    $status = "down"
    EndFunc
    Func _up()
    $status = "up"
    EndFunc
    Func _left()
    $status = "left"
    EndFunc
    Func _right()
    $status = "right"
    EndFunc

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

    Func _walltouch()
    if $snakerandomleft >= 1056 +32 or $snakerandomleft <31 Then _gameover()
    if $snakerandomtop >= 704 or $snakerandomtop < 32 Then _gameover()
    EndFunc
    Func _gameover()
    If $highscore > $oldhighscore Then
    $yesno = MsgBox(4, "NEW RECORD", "Neuer Highscore!!!" & @CRLF & "Deine Neue Pkt-Zahl: " & $highscore & @CRLF & "Deine Alte Pkt-Zahl: " & $oldhighscore & @CRLF & "Neustart?")
    FileDelete(@TempDir & "Highscore.hsc")
    FileWrite(@TempDir & "Highscore.hsc", $highscore)
    if $yesno = 6 Then _neustart()
    if $yesno = 7 Then Exit

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

    EndIf
    if $highscore < $oldhighscore Then
    $yesno = MsgBox(4, "Schade", "Game Over" & @CRLF & "Deine Neue Punktzahl: " & $highscore & @CRLF & "Dein Highscore: " & $oldhighscore & @CRLF & "Neustart?")
    if $yesno = 6 then _neustart()
    if $yesno = 7 Then Exit

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

    EndIf
    if $highscore = $oldhighscore Then
    $yesno = MsgBox(4, "Gleichstand", "Game Over" & @CRLF & "Deine Neue Punktzahl: " & $highscore & @CRLF & "Dein Highscore: " & $oldhighscore & @CRLF & "Neustart?")
    if $yesno = 6 then _neustart()
    if $yesno = 7 then Exit

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

    EndIf

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

    EndFunc
    Func _appletouch()
    if $snakerandomleft = $appleleft And $snakerandomtop = $appletop Then
    Switch $level
    case "1"
    $highscore = $highscore +1
    case "2"
    $highscore = $highscore + 1.5
    Case "3"
    $highscore = $highscore +2
    Case "4"
    $highscore = $highscore + 2.5
    Case "5"
    $highscore = $highscore +3
    Case "6"
    $highscore = $highscore +3.5
    Case "7"
    $highscore = $highscore +4
    Case "8"
    $highscore = $highscore +4.5
    Case "9"
    $highscore = $highscore + 5
    Case "10"
    $highscore = $highscore + 5.5
    Case "Wahnsinn!"
    $highscore = $highscore + 8
    EndSwitch

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

    $vlack = GUICtrlCreateIcon(@TempDir & $oldpiece & ".ico", 0, $appleleft, $appletop, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
    _addapple()
    EndIf

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

    EndFunc

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

    Func _addapple()
    While 1
    $appleleft = Random(36, 750, 1)
    if Mod($appleleft, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $appletop = Random(36, 680, 1)
    if Mod($appletop, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    $apple = GUICtrlCreatePic(@TempDir & "Apfel__.bmp",$appleleft, $appletop, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $speed = $speed / 2
    EndFunc

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

    Func _neustart()
    $highscore = 0
    While 1
    $appleleft = Random(36, 750, 1)
    if Mod($appleleft, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $appletop = Random(36, 680, 1)
    if Mod($appletop, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    GUICtrlSetPos($apple, $appleleft, $appletop)
    if $level = "1" Then $speed = 600
    if $level = "2" Then $speed = 550
    if $level = "3" Then $speed = 500
    if $level = "4" Then $speed = 450
    if $level = "5" Then $speed = 400
    if $level = "6" Then $speed = 350
    if $level = "7" Then $speed = 300
    if $level = "8" Then $speed = 250
    if $level = "9" Then $speed = 200
    if $level = "10" Then $speed = 150
    if $level = "Wahnsinn!" then $speed = 1
    $status = ""
    While 1
    $snakerandomleft = Random(64, 736, 1)
    if Mod($snakerandomleft, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    While 1
    $snakerandomtop = Random(64, 680, 1)
    if Mod($snakerandomtop, 16) = 0.0 Then
    ExitLoop
    EndIf
    WEnd
    GUICtrlSetPos($snake, $snakerandomleft, $snakerandomtop)
    $timer = TimerInit()
    $nowtime = TimerDiff($timer)
    $xtimex = $nowtime / 1000
    $xtimex = Round($xtimex)
    if $xtimex = 200 Then _gameover()
    $tip = ToolTip($xtimex & "/" & 200, MouseGetPos(0), MouseGetPos(1))
    EndFunc

    [/autoit]

    autoit.de/wcf/attachment/6107/

    [autoit]


    While $Life = True
    $nMSG = BrainGetMsg()
    Switch $nMSG
    Case $Idea
    _Convert_Idea2Code()
    EndSwitch
    WEnd

    [/autoit]
  • also bei mir funktionierts, und es macht wirklich spass.. :)

    gute arbeit..schade nur, dass beim wechseln der geschwindigkeit, iergendwie eine verzögerung zu spüren ist..

    weiter so!

  • bei mir läufts auch, kanns mir leider nur nich genauer ansehn, weil ich in da arbeit bin, und spielen is dann doch übertrieben.
    sieht aber schonmal klasse aus.
    ich schaus mir dann zuhause nochmal genauer an ;)

  • Schönes Spiel!!!

    Nur der Code is echt fast nicht lesbar (nicht böse gemeint)

    Fersuch mal es in bereiche zu teilen, und bei den Schleifen/ funktionen die "Bestandteile" ein stückchen einzurücken, dann geht das sicher besser.

    mfg

    Computers are like Airconditioning. They don´t work with open Windows.

  • ja ich weiß^^ das ist mein Problem^^
    Ich versuch mich ab heut an nem Neuen Spiel, dam versuch ichs besser zu machen :D
    Block Breaker (Ist auf vielen Sony Ericsson Handys)

    [autoit]


    While $Life = True
    $nMSG = BrainGetMsg()
    Switch $nMSG
    Case $Idea
    _Convert_Idea2Code()
    EndSwitch
    WEnd

    [/autoit]