Schönes Spiel, hierdurch läufts:
Spoiler anzeigen
;Fenster:
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]#include
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\salvatore monachello\eigene dateien\snake.kxf
$Form1_1 = GUICreate("Snake", 633, 447, 190, 119)
$Button1 = GUICtrlCreateButton("Weiter", 488, 400, 113, 33, 0)
$Button2 = GUICtrlCreateButton("Abbrechen", 343, 400, 113, 33, 0)
$Label1 = GUICtrlCreateLabel("Spiele Snake auf Computer", 160, 32, 323, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Die Steuerung:", 256, 104, 111, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("Die Steuerung erfolgt durch das Drücken der Pfeiltaste ", 152, 160, 300, 17)
$Label4 = GUICtrlCreateLabel("Vorsicht das Spiel startet sofort!!!", 152, 176, 158, 17)
$Label5 = GUICtrlCreateLabel("Viel Glück!!!!!!!!!", 160, 312, 79, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg=GuiGetMsg()
If $msg=-3 Then Exit
If $msg=$Button1 Then ExitLoop
If $msg=$Button2 Then button2()
WEnd
;~ Func button1 () ;button=weiter
;~ sleep (100)
;~ Exit(1) ;WÜRDE HEIßEN, DASS DAS SCRIPT BEENDET WIRD!!!
;~ EndFunc
Func button2 () ;button=abbrechen
Sleep (100)
Exit (1)
EndFunc
;Fenster ende:
;snake:
#include
#include
#include
#include
#include
FileInstall("Snake2.png", @TempDir & "\Snake2.png", 1)
FileInstall("Snake.wav", @TempDir & "\Snake.wav", 1)
FileInstall("Snake1.wav", @TempDir & "\Snake1.wav", 1)
FileInstall("Snake2.wav", @TempDir & "\Snake2.wav", 1)
Global $sCatch = "123456789"
Global $iCatch = StringLen($sCatch)
Global $SND1 = _SoundOpen(@TempDir & "\Snake.wav")
Global $SND2 = _SoundOpen(@TempDir & "\Snake1.wav")
Global $SND3 = _SoundOpen(@TempDir & "\Snake2.wav")
Global $hBitmap, $hScreen, $hGraphic, $hBrush, $hGUI, $hCursor, $hGraphic1
Global $LeftID, $RightID, $DownID, $UpID
Global $iDirection = 0, $iDirectionOld = 0, $iPosX, $iPosY, $iCount = 0, $iCPosX, $iCPosY
Global $aPos[1000][3], $iSnakeLen = 0
Global $DesktopWidth = @DesktopWidth, $DesktopHeight = @DesktopHeight
$DesktopHeight -= Mod($DesktopHeight, 20)
$DesktopWidth -= Mod($DesktopWidth, 20)
Global $iRound = 1, $iCatchX = -50, $iCatchY = -50, $iLevel = 0, $iLevelMax = 6
Global $aWall[2][2]
$aWall[0][0] = 0
_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hBitmap = _ScreenCapture_Capture("", 0, 0, -1, -1, 0)
$hScreen = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
$hBrushSnake = _GDIPlus_BrushCreateSolid(0xFF00FF00)
$hPenSnake = _GDIPlus_PenCreate(0xFF003300, 2)
$hBrushWall = _GDIPlus_BrushCreateSolid(0xBBFF0000)
$hBrushOutLine = _GDIPlus_BrushCreateSolid(0xBBFF0000)
$hPenWall = _GDIPlus_PenCreate(0xFF330000, 2)
$hBrushBlack = _GDIPlus_BrushCreateSolid(0xFF000000)
[/autoit] [autoit][/autoit] [autoit]$hBrushBk = _GDIPlus_BrushCreateSolid(0x110000FF)
$hBrushCurShad = _GDIPlus_BrushCreateSolid(0x55000000)
$hBrushCursor = _GDIPlus_BrushCreateSolid(0x66FF7700)
$hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hScreen)
_GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, $DesktopWidth, $DesktopHeight, $hBrushBk)
$hCursor = _GDIPlus_BitmapCreateFromFile(@TempDir & "\Snake2.png")
$iCPosX = $DesktopWidth - 125
$iCPosY = $DesktopHeight - 100
_GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCurShad)
_GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCurShad)
_GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCurShad)
_GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCurShad)
_GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, $DesktopWidth, 20, $hBrushOutLine)
_GDIPlus_GraphicsFillRect($hGraphic1, 0, $DesktopHeight - 20, $DesktopWidth, 20, $hBrushOutLine)
_GDIPlus_GraphicsFillRect($hGraphic1, 0, 20, 20, $DesktopHeight - 40, $hBrushOutLine)
_GDIPlus_GraphicsFillRect($hGraphic1, $DesktopWidth - 20, 20, $DesktopWidth, $DesktopHeight - 40, $hBrushOutLine)
_GDIPlus_GraphicsDrawRect($hGraphic1, 19, 19, $DesktopWidth - 39, $DesktopHeight - 39, $hPenWall)
$iCPosX += 5
$iCPosY -= 5
Opt("GuiOnEventMode", 1)
Opt("PixelCoordMode", 2)
$hGUI = GUICreate("Eukalyptus Snake", $DesktopWidth, $DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$LeftID = GUICtrlCreateButton("", 0, -90)
GUICtrlSetOnEvent(-1, "_Left")
GUICtrlSetState(-1, $GUI_HIDE)
$RightID = GUICtrlCreateButton("", 0, -70)
GUICtrlSetOnEvent(-1, "_Right")
GUICtrlSetState(-1, $GUI_HIDE)
$DownID = GUICtrlCreateButton("", 0, -50)
GUICtrlSetOnEvent(-1, "_Down")
GUICtrlSetState(-1, $GUI_HIDE)
$UpID = GUICtrlCreateButton("", 0, -30)
GUICtrlSetOnEvent(-1, "_Up")
GUICtrlSetState(-1, $GUI_HIDE)
Dim $AccelKeys[4][2] = [["{Left}", $LeftID],["{Right}", $RightID],["{Down}", $DownID],["{Up}", $UpID]]
GUISetAccelerators($AccelKeys)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_PAINT, '_Redraw')
_GDIPlus_GraphicsDrawImage($hGraphic, $hScreen, 0, 0)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
_Success()
[/autoit] [autoit][/autoit] [autoit]While 1
If $iCount >= 4 Then
_NewDir()
$iCount = 0
EndIf
$iCount += 1
_Move()
Sleep(20)
If PixelGetColor(10, 10, $hGUI) = 0 Then
_ReDraw(0, 0, 0, 0)
EndIf
WEnd
Func _Round1()
Return
EndFunc ;==>_Round1
Func _Round2()
Local $iCnt = 0, $iX = 100
While $iX < $DesktopWidth - 100
$iCnt += 1
ReDim $aWall[$iCnt + 1][2]
$aWall[$iCnt][0] = $iX
$aWall[$iCnt][1] = $DesktopHeight / 2
$aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
$aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
$iX += 20
WEnd
$aWall[0][0] = $iCnt
_DrawWall()
EndFunc ;==>_Round2
Func _Round5()
Local $iCnt = 0, $iX = 40
While $iX < $DesktopWidth - 30
$iCnt += 1
ReDim $aWall[$iCnt + 1][2]
$aWall[$iCnt][0] = $iX
$aWall[$iCnt][1] = $DesktopHeight / 2
$aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
$aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
$iX += 40
WEnd
$aWall[0][0] = $iCnt
_DrawWall()
EndFunc ;==>_Round5
Func _Round4()
Local $iCnt = 0, $iX = 100
For $i = 100 To $DesktopHeight - 100 Step 160
$iX = 100
While $iX < $DesktopWidth - 100
$iCnt += 1
ReDim $aWall[$iCnt + 1][2]
$aWall[$iCnt][0] = $iX
$aWall[$iCnt][1] = $i
$aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
$aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
$iX += 20
WEnd
Next
$aWall[0][0] = $iCnt
_DrawWall()
EndFunc ;==>_Round4
Func _Round3()
Local $iCnt = 0, $iX = 100
While $iX < $DesktopWidth - 100
$iCnt += 1
ReDim $aWall[$iCnt + 1][2]
$aWall[$iCnt][0] = $iX
$aWall[$iCnt][1] = $DesktopHeight / 2
$aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
$aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
$iX += 20
WEnd
$iX = 100
While $iX < $DesktopHeight - 100
$iCnt += 1
ReDim $aWall[$iCnt + 1][2]
$aWall[$iCnt][0] = $DesktopWidth / 2
$aWall[$iCnt][1] = $iX
$aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
$aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
$iX += 20
WEnd
$aWall[0][0] = $iCnt
_DrawWall()
EndFunc ;==>_Round3
Func _DrawWall()
Local $iX = $aWall[1][0], $iY = $aWall[1][1], $iDir = 0
For $i = 1 To $aWall[0][0]
_GDIPlus_GraphicsFillRect($hGraphic, $aWall[$i][0], $aWall[$i][1], 20, 20, $hBrushWall)
If $i = 1 Then ContinueLoop
If (($aWall[$i][0] - 20 = $aWall[$i - 1][0]) And ($aWall[$i - 1][1] = $aWall[$i][1])) Then
$iDir = 0
If $i < $aWall[0][0] Then ContinueLoop
ElseIf (($aWall[$i][0] = $aWall[$i - 1][0]) And ($aWall[$i - 1][1] = $aWall[$i][1] - 20)) Then
$iDir = 1
If $i < $aWall[0][0] Then ContinueLoop
Else
If $iDir = 0 Then _GDIPlus_GraphicsDrawRect($hGraphic, $iX + 1, $aWall[$i - 1][1] + 1, $aWall[$i - 1][0] - $iX + 18, 18, $hPenWall)
If $iDir = 1 Then _GDIPlus_GraphicsDrawRect($hGraphic, $aWall[$i - 1][0] + 1, $iY + 1, 18, $aWall[$i - 1][1] + 18, $hPenWall)
$iX = $aWall[$i][0]
$iY = $aWall[$i][1]
EndIf
If $i = $aWall[0][0] Then
If $iDir = 0 Then _GDIPlus_GraphicsDrawRect($hGraphic, $iX + 1, $aWall[$i - 1][1] + 1, $aWall[$i][0] - $iX + 18, 18, $hPenWall)
If $iDir = 1 Then _GDIPlus_GraphicsDrawRect($hGraphic, $aWall[$i - 1][0] + 1, $iY + 1, 18, $aWall[$i][1] - $iY + 18, $hPenWall)
EndIf
Next
EndFunc ;==>_DrawWall
Func _NewDir()
Local $bCursor = False
If $iDirectionOld <> $iDirection Then $bCursor = True
_CheckCrash()
If $bCursor = True Then
Switch $iDirectionOld
Case 0
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 0, 38, 28, 34, $iCPosX, $iCPosY + 38, 28, 34)
Case 1
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 64, 38, 28, 34, $iCPosX + 64, $iCPosY + 38, 28, 34)
Case 2
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 32, 38, 28, 34, $iCPosX + 32, $iCPosY + 38, 28, 34)
Case 3
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 32, 0, 28, 34, $iCPosX + 32, $iCPosY, 28, 34)
EndSwitch
EndIf
$iDirectionOld = $iDirection
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hScreen, $aPos[$iSnakeLen][0], $aPos[$iSnakeLen][1], 20, 20, $aPos[$iSnakeLen][0], $aPos[$iSnakeLen][1], 20, 20)
If $aPos[$iSnakeLen][0] >= $iCPosX - 20 And $aPos[$iSnakeLen][1] >= $iCPosY - 20 Then _GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
If $bCursor = True Or ($aPos[$iSnakeLen][0] >= $iCPosX - 20 And $aPos[$iSnakeLen][1] >= $iCPosY - 20) Then
Switch $iDirectionOld
Case 0
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 1
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 2
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 3
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCursor)
EndSwitch
EndIf
For $i = $iSnakeLen To 1 Step -1
$aPos[$i][0] = $aPos[$i - 1][0]
$aPos[$i][1] = $aPos[$i - 1][1]
$aPos[$i][2] = $aPos[$i - 1][2]
Next
$aPos[0][0] = $iPosX
$aPos[0][1] = $iPosY
$aPos[0][2] = $iDirectionOld
EndFunc ;==>_NewDir
Func _CheckCrash()
If $iPosX <= 0 Or $iPosX >= $DesktopWidth - 20 Or $iPosY <= 0 Or $iPosY >= $DesktopHeight - 20 Then _Fail()
For $i = 0 To $iSnakeLen
If $iPosX = $aPos[$i][0] And $iPosY = $aPos[$i][1] Then _Fail()
If $iPosX > $iCatchX - 10 And $iPosY > $iCatchY - 10 And $iPosX <= $iCatchX + 40 And $iPosY <= $iCatchY + 40 Then _NewRound()
Next
For $i = 0 To $aWall[0][0]
If $iPosX = $aWall[$i][0] And $iPosY = $aWall[$i][1] Then _Fail()
Next
EndFunc ;==>_CheckCrash
Func _NewRound()
If StringMid($sCatch, $iRound, 1) = " " Then
$iRound += 1
Return
EndIf
Local $bSuc = False
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hScreen, $iCatchX, $iCatchY, 40, 40, $iCatchX, $iCatchY, 40, 40)
Do
$iCatchX = Random(50, $DesktopWidth - 90, 1)
$iCatchY = Random(50, $DesktopHeight - 150, 1)
$iCatchX -= Mod($iCatchX, 20)
$iCatchY -= Mod($iCatchY, 20)
For $i = 0 To $iSnakeLen
If $iCatchX >= $aPos[$i][0] - 50 And $iCatchY >= $aPos[$i][1] - 50 And $iCatchX <= $aPos[$i][0] + 10 And $iCatchY <= $aPos[$i][1] + 10 Then
$bSuc = False
ExitLoop
Else
$bSuc = True
EndIf
Next
If $bSuc = False Then ContinueLoop
For $i = 0 To $aWall[0][0]
If $iCatchX >= $aWall[$i][0] - 50 And $iCatchY >= $aWall[$i][1] - 50 And $iCatchX <= $aWall[$i][0] + 10 And $iCatchY <= $aWall[$i][1] + 10 Then
$bSuc = False
ExitLoop
Else
$bSuc = True
EndIf
Next
Until $bSuc = True
_SoundPlay($SND1, 0)
_Write(StringMid($sCatch, $iRound, 1))
_DrawPosRefresh(1, 0)
$iRound += 1
$iSnakeLen += 15
If $iSnakeLen > 999 Then $iSnakeLen = 999
If $iRound > $iCatch + 1 Then _Success()
$iBlinkTimer = TimerInit()
$bBlinkColor = True
EndFunc ;==>_NewRound
Func _Write($sString, $iX = $iCatchX, $iY = $iCatchY, $iC = 0)
Local $iXL = StringLen($sString) * 40
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
Local $hFont = _GDIPlus_FontCreate($hFamily, 30, 1)
Local $hBrush1 = $hBrushBlack
Local $tLayout
Local $aInfo
For $i = -1 To 1
For $j = -1 To 1
$tLayout = _GDIPlus_RectFCreate($iX + $i * 2, $iY + $j * 2, $iXL, 40)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush1)
Next
Next
$tLayout = _GDIPlus_RectFCreate($iX, $iY, $iXL, 40)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 30, 1)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
$hBrush1 = $hBrushSnake
_GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush1)
EndFunc ;==>_Write
Func _DrawPosRefresh($iS, $iE)
For $i = $iS To $iE Step -1
For $j = 1 To 4
Switch $aPos[$i][2]
Case 0
_DrawPos($aPos[$i][0] - 5 * $j, $aPos[$i][1], $aPos[$i][2])
Case 1
_DrawPos($aPos[$i][0] + 5 * $j, $aPos[$i][1], $aPos[$i][2])
Case 2
_DrawPos($aPos[$i][0], $aPos[$i][1] + 5 * $j, $aPos[$i][2])
Case 3
_DrawPos($aPos[$i][0], $aPos[$i][1] - 5 * $j, $aPos[$i][2])
EndSwitch
Next
Next
EndFunc ;==>_DrawPosRefresh
Func _DrawPos($iX, $iY, $iD)
_GDIPlus_GraphicsFillRect($hGraphic, $iX + 2, $iY + 2, 16, 16, $hBrushSnake)
Switch $iD
Case 0
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 6, $iY + 1, $iX + 1, $iY + 1, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 1, $iX + 1, $iY + 19, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 19, $iX + 6, $iY + 19, $hPenSnake)
Case 1
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 13, $iY + 1, $iX + 19, $iY + 1, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 1, $iX + 19, $iY + 19, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 19, $iX + 13, $iY + 19, $hPenSnake)
Case 2
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 13, $iX + 1, $iY + 19, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 19, $iX + 19, $iY + 19, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 19, $iX + 19, $iY + 13, $hPenSnake)
Case 3
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 6, $iX + 1, $iY + 1, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 1, $iX + 19, $iY + 1, $hPenSnake)
_GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 1, $iX + 19, $iY + 6, $hPenSnake)
EndSwitch
If $iX >= $iCPosX - 20 And $iY >= $iCPosY - 20 Then
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
Switch $iDirectionOld
Case 0
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 1
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 2
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCursor)
Case 3
_GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCursor)
EndSwitch
EndIf
EndFunc ;==>_DrawPos
Func _Move()
Switch $iDirectionOld
Case 0
$iPosX -= 5
Case 1
$iPosX += 5
Case 2
$iPosY += 5
Case 3
$iPosY -= 5
EndSwitch
_DrawPos($iPosX, $iPosY, $iDirectionOld)
EndFunc ;==>_Move
Func _Left()
If $iDirectionOld <> 1 Then $iDirection = 0
EndFunc ;==>_Left
Func _Right()
If $iDirectionOld <> 0 Then $iDirection = 1
EndFunc ;==>_Right
Func _Down()
If $iDirectionOld <> 3 Then $iDirection = 2
EndFunc ;==>_Down
Func _Up()
If $iDirectionOld <> 2 Then $iDirection = 3
EndFunc ;==>_Up
Func _ReDraw($hwnd, $msg, $wparam, $lparam)
_GDIPlus_GraphicsDrawImage($hGraphic, $hScreen, 0, 0)
_DrawPosRefresh($iSnakeLen, 1)
_Write(StringMid($sCatch, $iRound - 1, 1))
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
_DrawWall()
Return $GUI_RUNDEFMSG
EndFunc ;==>_ReDraw
Func _Success()
If $iLevel > 0 Then _SoundPlay($SND2, 1)
For $i = 0 To 999
$aPos[$i][0] = -50
$aPos[$i][1] = -50
$aPos[$i][2] = 5
Next
$iLevel += 1
If $iLevel >= $iLevelMax Then _Exit()
Call("_Round" & $iLevel)
$iPosX = 20
$iPosY = 20
$aPos[0][0] = $iPosX
$aPos[0][1] = $iPosY
$iDirection = 1
$iDirectionOld = 1
$iSnakeLen = 0
$iRound = 1
$iCount = 0
_NewRound()
_ReDraw(0, 0, 0, 0)
EndFunc ;==>_Success
Func _Fail()
_SoundPlay($SND3, 1)
_Exit()
EndFunc ;==>_Fail
Func _Exit()
_GDIPlus_Shutdown()
FileDelete(@TempDir & "\Snake2.png")
FileDelete(@TempDir & "\Snake.wav")
FileDelete(@TempDir & "\Snake1.wav")
FileDelete(@TempDir & "\Snake2.wav")
Exit
sleep(100)
run("setup start.exe")
EndFunc ;==>_Exit
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];snake ende:
[/autoit]
An deiner Stelle würd ich noch eine Meldung machen, wenn man verliert, nicht einfach beenden.P.S.: Ach, und Forschlag schreibt man mit "V".