In die richtige Richtung bewegen

  • Hallo, leute, ich schon wieder^^
    Ich hab schon wieder ein Problem:
    Ich möchte ein Spiel machen, wo man eine Person (Bild^^) Bewegen kann. Ich hab es so gemacht das wenn ich links - rechts drücke, das er sich dann dreht, und wenn man oben - unten drückt, das der Vorwärz - rückwärz läuft.
    Mein Problem ist das er dann in die Richtige richtung läuft, also in die richtung in die er gedreht ist. Ich hab schon ein bischen rumprobiert, geht aber noch nicht richtig :(
    Kann mir jemand sagen wie ich das Rechen muss?

    Ich mache das Script in Dateianhang, weil man ja auch ein Bild braucht.

    mfg. Jam00

  • ich glaub das man das bild nur pixelweise verschieben kann ?!

    ich würd dir dann empfehlen die bewegung auf 8/16 richtungen zu beschränken!

    man kann zwar sicher ausrechnen, wie die person sich bewegen müsste, aber ob man dass bei der genauigkeit von einem pixel überhaupt sehen kann?

    Canyon

  • Klar kann man das nur einen mindestens einen Pixel verschieben! Ich glaub ich hab die Rechnunh jetzt auch richtig, aber ich glaube, wenn ich in der Matrix was bewege bewegt sich das bild nicht ganu dahin!
    Hier mal das Script wie es jetzt aussieht

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    _GDIPlus_Startup()

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

    $X = 500
    $Y = 800

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

    $hGui = GUICreate("Laufen", @DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
    GUISetBkColor (0xFFFFFF)
    GUISetState()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
    $iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $X, $Y)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    $Rotate = 0
    $Speed = 20
    While GUIGetMsg() <> -3
    ToolTip ($Rotate & "," & $X & "," & $Y)
    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf
    If _IsPressed ("27") Then
    $Rotate += 5
    _GDIPlus_MatrixRotate($hMatrix, 5, "False")
    _Draw()
    ElseIf _IsPressed ("25") Then
    $Rotate -= 5
    _GDIPlus_MatrixRotate($hMatrix, -5, "False")
    _Draw()
    EndIf
    If _IsPressed ("26") Then
    If $Rotate <= 90 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $Y = $Y - Round ($Speed - ($Speed / 100 * Round ($Rotate / 90 * 100,0)) ,0)
    ElseIf $Rotate <= 180 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 180 * 100,0),0)
    $Y = $Y + Round ($Speed - ($Speed / 100 * Round ($Rotate / 180 * 100,0)),0)
    ElseIf $Rotate <= 270 Then
    $X = $X - Round ($Speed / 100 * Round ($Rotate / 270 * 100,0),0)
    $Y = $Y - Round ($Speed - ($Speed / 100 * Round ($Rotate / 270 * 100,0)),0)
    ElseIf $Rotate <= 360 Then
    $X = $X - Round ($Speed / 100 * Round ($Rotate / 360 * 100,0),0)
    $Y = $Y + Round ($Speed - ($Speed / 100 * Round ($Rotate / 180 * 100,0)),0)
    EndIf
    _Draw2()
    ElseIf _IsPressed ("28") Then
    If $Rotate <= 90 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $Y = $Y + Round ($Speed - ($Speed / 100 * Round ($Rotate / 90 * 100,0)),0)
    ElseIf $Rotate <= 180 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 180 * 100,0),0)
    $Y = $Y - Round ($Speed - ($Speed / 100 * Round ($Rotate / 180 * 100,0)),0)
    ElseIf $Rotate <= 270 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 270 * 100,0),0)
    $Y = $Y + Round ($Speed - ($Speed / 100 * Round ($Rotate / 270 * 100,0)),0)
    ElseIf $Rotate <= 360 Then
    $X = $X + Round ($Speed / 100 * Round ($Rotate / 360 * 100,0),0)
    $Y = $Y - Round ($Speed - ($Speed / 100 * Round ($Rotate / 180 * 100,0)),0)
    EndIf
    _Draw2()
    EndIf
    Sleep(10)
    WEnd

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

    Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    EndFunc ;==>WM_PAINT

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

    Func _Draw()
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    EndFunc
    Func _Draw2()
    _GDIPlus_MatrixDispose($hMatrix)
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixRotate($hMatrix,$Rotate, "False")
    _GDIPlus_MatrixTranslate($hMatrix, $X, $Y)
    _Draw()
    EndFunc

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

    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

    [/autoit]


    EDIT:
    Hab es mal so Probiert:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <Inet.au3>

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

    Example()

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

    Func Example()
    TCPStartup()
    $MainSocket = TCPListen(@ipaddress1,12,100)
    DO
    $ConnectedSocket = TCPAccept($MainSocket)
    Until $ConnectedSocket <> -1
    While 1
    $a = inputbox("Send","Senden")
    tcpsend($ConnectedSocket,$a)
    WEnd
    TCPShutdown()
    EndFunc

    [/autoit]

    mfg. Jam00

    Einmal editiert, zuletzt von Jam00 (23. März 2009 um 21:50)

  • Okay, das er in die richtige richtung geht hab ich jetzt hinbekommen, aber jetzt zeigt er das Bild nicht mehr richtig an! Also die Positon wo er es malen soll stimm! Aber er malt es nicht richtig!

    Das wo man erkennen kann das jetzt richtig läuft
    [autoit]

    #include <GDIPlus.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    _GDIPlus_Startup()

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

    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
    $X = @DesktopWidth / 2 - _GDIPlus_ImageGetWidth($hImage)
    $Y = @DesktopHeight / 2 - _GDIPlus_ImageGetHeight($hImage)

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

    $hGui = GUICreate("Laufen", _GDIPlus_ImageGetWidth($hImage),_GDIPlus_ImageGetHeight($hImage),$X,$Y,$WS_POPUP)
    GUISetBkColor (0xFFFFFF)
    GUISetState()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
    $iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, 0, 0)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    _GDIPlus_MatrixRotate($hMatrix, 0, False)
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
    $Rotate = 0
    $Speed = 20
    While GUIGetMsg() <> -3
    ToolTip ($Rotate & "," & $X & "," & $Y)
    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf
    If _IsPressed ("27") Then
    $Rotate += 5
    _GDIPlus_MatrixRotate($hMatrix, 5, True)
    _Draw()
    ElseIf _IsPressed ("25") Then
    $Rotate -= 5
    _GDIPlus_MatrixRotate($hMatrix, -5, True)
    _Draw()
    EndIf
    If _IsPressed ("26") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $X += $X1
    $Y -= ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += ($Speed - $X1)
    $Y += $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= $X1
    $Y += ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= ($Speed - $X1)
    $Y -= $X1
    EndIf
    _Draw1()
    ElseIf _IsPressed ("28") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $X -= $X1
    $Y += ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= ($Speed - $X1)
    $Y -= $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += $X1
    $Y -= ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += ($Speed - $X1)
    $Y += $X1
    EndIf
    _Draw1()
    EndIf
    Sleep(10)
    WEnd

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

    Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _GDIPlus_MatrixRotate($hMatrix, $Rotate, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
    EndFunc ;==>WM_PAINT

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

    Func _Draw()
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
    EndFunc
    Func _Draw1()
    WinMove ($hGui,"",$X,$Y)
    EndFunc

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

    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

    [/autoit]
    Das wo er es Falsch zeichent
    [autoit]

    #include <GDIPlus.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Test Rotate", @DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
    GUISetBkColor (0xFFFFFF)
    GUISetState()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\Gun\1.png")
    $iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, 500, 800)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    $X = 500
    $Y = 800
    $Rotate = 0
    $Speed = 20
    While GUIGetMsg() <> -3
    ToolTip ($Rotate & "," & $X & "," & $Y)
    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf
    If _IsPressed ("27") Then
    $Rotate += 5
    _GDIPlus_MatrixRotate($hMatrix, 5, True)
    _Draw()
    ElseIf _IsPressed ("25") Then
    $Rotate -= 5
    _GDIPlus_MatrixRotate($hMatrix, -5, True)
    _Draw()
    EndIf
    If _IsPressed ("26") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $X += $X1
    $Y -= ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += ($Speed - $X1)
    $Y += $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= $X1
    $Y += ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= ($Speed - $X1)
    $Y -= $X1
    EndIf
    _Draw()
    ElseIf _IsPressed ("28") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $X -= $X1
    $Y += ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X -= ($Speed - $X1)
    $Y -= $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += $X1
    $Y -= ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $X += ($Speed - $X1)
    $Y += $X1
    EndIf
    _Draw()
    EndIf
    Sleep(10)
    WEnd

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

    Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    EndFunc ;==>WM_PAINT

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

    Func _Draw()
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage,$X -$iWidth / 2,$Y -$iHeight / 2)
    EndFunc

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

    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

    [/autoit]

    Bitte um hilfe, pleas

    mfg. Jam00

  • Oh, schuldigung, ahbe nicht dran gedacht!
    Ähm, hier hab ich es mal ohne Drehen geacht, also das er das nicht anzeigt, und schon geht es! Nur wenn die drehung nicht angezeigt wird ist ja auch scheiße

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Test Rotate", @DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
    GUISetBkColor (0xFFFFFF)
    GUISetState()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
    $iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
    ;~ $hMatrix = _GDIPlus_MatrixCreate()
    ;~ _GDIPlus_MatrixTranslate($hMatrix, 500, 800)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    ;~ _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    ;~ _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    $X = 500
    $Y = 800
    $Rotate = 0
    $Speed = 20
    While GUIGetMsg() <> -3
    ToolTip ($Rotate)
    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf
    If _IsPressed ("27") Then
    $Rotate += 5
    ;~ _GDIPlus_MatrixRotate($hMatrix, 5, True)
    _Draw($X,$Y)
    ElseIf _IsPressed ("25") Then
    $Rotate -= 5
    ;~ _GDIPlus_MatrixRotate($hMatrix, -5, True)
    _Draw($X,$Y)
    EndIf
    If _IsPressed ("26") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $Xt = $X + $X1
    $Yt = $Y - ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X +($Speed - $X1)
    $Yt = $Y + $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X - $X1
    $Yt = $Y + ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X - ($Speed - $X1)
    $Yt = $Y - $X1
    EndIf
    _Draw($Xt,$Yt)
    ElseIf _IsPressed ("28") Then
    If $Rotate <= 90 Then
    $X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
    $Xt = $X - $X1
    $Yt = $Y + ($Speed - $X1)
    ElseIf $Rotate <= 180 Then
    $Rotate1 = $Rotate - 90
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X -($Speed - $X1)
    $Yt = $Y - $X1
    ElseIf $Rotate <= 270 Then
    $Rotate1 = $Rotate - 180
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X + $X1
    $Yt = $Y - ($Speed - $X1)
    ElseIf $Rotate <= 360 Then
    $Rotate1 = $Rotate - 270
    $X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
    $Xt = $X + ($Speed - $X1)
    $Yt = $Y + $X1
    EndIf
    _Draw($Xt,$Yt)
    EndIf
    Sleep(10)
    WEnd

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

    Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    ;~ _GDIPlus_MatrixRotate($hMatrix, 0, "False")
    ;~ _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
    EndFunc ;==>WM_PAINT

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

    Func _Draw($Xt,$Yt)
    $X = $Xt
    $Y = $Yt
    If $X < 0 Then
    $X = 0
    EndIf
    If $X > @DesktopWidth - _GDIPlus_ImageGetWidth($hImage) Then
    $X = @DesktopWidth - _GDIPlus_ImageGetWidth($hImage)
    EndIf
    If $Y < 0 Then
    $Y = 0
    EndIf
    If $Y > @DesktopHeight -_GDIPlus_ImageGetHeight($hImage) Then
    $Y = @DesktopHeight -_GDIPlus_ImageGetHeight($hImage)
    EndIf
    ;~ _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage,$X,$Y)
    EndFunc

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

    ;~ _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

    [/autoit]

    mfg. Jam00