1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. F4R

Beiträge von F4R

  • GDIPlus Ebene erstellen ?

    • F4R
    • 14. September 2013 um 22:48

    Hallo Leute,
    Ich bin gerade dabei ein eigenes Spiel zu Programmieren, welches sich noch in der frühesten Anfangsphase befindet
    Das Spiel kann eine txt Datei Lesen und diese in eine Map im Spiel umwandeln.
    Diese Map soll auf eine eigene "Ebene" gezeichnet werden, sodass ich sie verschieben kann und immer direkt die
    Map auf einmal zeichnen kann. Bitte nicht erschrecken... der Skript ist Ziemlich unstrukturiert und schlecht geschrieben d.h es
    liegen noch Fehler vor im sinne von unnötigen Zeilen.
    Nun seht selbst :

    Spoiler anzeigen
    [autoit]

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

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

    $hGui = GUICreate("Heart-Eater", 513, 513)
    GUISetState(@SW_SHOW)

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

    _GDIPlus_Startup()

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

    $char = _GDIPlus_ImageLoadFromFile(@Scriptdir & "\data\char\char.png")
    $schatten = _GDIPlus_ImageLoadFromFile(@Scriptdir & "\data\char\schatten.png")
    $hintergrund = _GDIPlus_ImageLoadFromFile(@scriptdir & "\data\hintergrund.png")
    $SPS = _GDIPlus_ImageLoadFromFile(@scriptdir&"\data\kachelspritesheet.png")

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

    $hGr_Frontbuffer = _GDIPlus_GraphicsCreateFromHWND($hGUI)

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

    $hBitmap_Backbuffer = _GDIPlus_BitmapCreateFromGraphics(600, 600, $hGr_Frontbuffer)
    $hGr_Backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap_Backbuffer)
    $hGr_Map = _GDIPlus_ImageGetGraphicsContext($hBitmap_Backbuffer)

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

    $BEWEG_SPEED = 50
    $BEWEG_RICHTUNG = 1
    $y = 0
    Global $aArray
    Local $mX, $mY
    $MAPY = 2000
    $MAPX = 2000

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

    ;===== HAUPTSCHLEIFE =========

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

    FullsAni()
    _openmap()

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

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg = -3 Then Exit
    If _IsPressed(57) Or _IsPressed(26) Then
    FullwAni()
    EndIf ; w
    If _IsPressed(41) Or _IsPressed(25) Then
    FullaAni()
    EndIf ; a
    If _IsPressed(53) Or _IsPressed(28) Then
    FullsAni()
    EndIf ; s
    If _IsPressed(44) Or _IsPressed(27) Then
    FulldAni()
    EndIf ; d
    If _IsPressed(10) Then
    $BEWEG_SPEED = 10
    Else
    $BEWEG_SPEED = 50
    EndIf
    WEnd

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

    ;====== BEWEGUNGS-RICHTUNGEN ========

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

    Func FullwAni()
    wAnimaD()
    If $BEWEG_RICHTUNG = 1 Then
    For $y = 0 To 128 Step 16
    $mY += 4
    _GDIPlus_GraphicsClear($hGr_Backbuffer,0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $y,32,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep($BEWEG_SPEED)
    Next
    EndIf
    $y = 0
    $BEWEG_RICHTUNG = 1
    EndFunc

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

    Func FullaAni()
    aAnimaD()
    If $BEWEG_RICHTUNG = 2 Then
    For $y = 0 To 128 Step 16
    $mX += 4
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $y,48,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep($BEWEG_SPEED)
    Next
    EndIf
    $y = 0
    $BEWEG_RICHTUNG = 2
    EndFunc

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

    Func FullsAni()
    sAnimaD()
    If $BEWEG_RICHTUNG = 3 Then
    For $y = 0 To 128 Step 16
    $mY -= 4
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $y,0,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep($BEWEG_SPEED)
    Next
    EndIf
    $y = 0
    $BEWEG_RICHTUNG = 3
    EndFunc

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

    Func FulldAni()
    dAnimaD()
    If $BEWEG_RICHTUNG = 4 Then
    For $y = 0 To 128 Step 16
    $mX -= 4
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $y,16,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep($BEWEG_SPEED)
    Next
    EndIf
    $y = 0
    $BEWEG_RICHTUNG = 4
    EndFunc

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

    ;====== BEWEGUNGS-DREUNGEN ========

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

    Func dAnima()
    If $BEWEG_RICHTUNG < 4 Then
    For $i = 128 To 192 Step 16
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $i,0,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep(20)
    Next
    EndIf
    EndFunc

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

    Func wAnima()
    If $BEWEG_RICHTUNG > 1 Then
    For $i = 128 To 192 Step 16
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $i,16,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep(20)
    Next
    EndIf
    EndFunc

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

    Func aAnima()
    If $BEWEG_RICHTUNG = 1 Or $BEWEG_RICHTUNG = 3 Or $BEWEG_RICHTUNG = 4 Then
    For $i = 128 To 192 Step 16
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $i,32,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep(20)
    Next
    EndIf
    EndFunc

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

    Func sAnima()
    If $BEWEG_RICHTUNG = 1 Or $BEWEG_RICHTUNG = 2 Or $BEWEG_RICHTUNG = 4 Then
    For $i = 128 To 192 Step 16
    _GDIPlus_GraphicsClear($hGr_Backbuffer, 0xFFFFFFFF)
    openMap()
    _GDIPlus_GraphicsDrawImage($hGr_Backbuffer, $schatten,265,280)
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Backbuffer, $char, $i,48,15,15,250,250,50,50)
    _GDIPlus_GraphicsDrawImage($hGr_Frontbuffer, $hBitmap_Backbuffer, 0, 0)
    Sleep(20)
    Next
    EndIf
    EndFunc

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

    Func wAnimaD()
    If $BEWEG_RICHTUNG = 2 Then
    sAnima()
    dAnima()
    wAnima()
    EndIf
    If $BEWEG_RICHTUNG = 3 Then
    dAnima()
    wAnima()
    EndIf
    If $BEWEG_RICHTUNG = 4 Then
    wAnima()
    EndIf
    EndFunc

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

    Func aAnimaD()
    If $BEWEG_RICHTUNG = 1 Then
    aAnima()
    EndIf
    If $BEWEG_RICHTUNG = 3 Then
    dAnima()
    wAnima()
    aAnima()
    EndIf
    If $BEWEG_RICHTUNG = 4 Then
    wAnima()
    aAnima()
    EndIf
    EndFunc

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

    Func sAnimaD()
    If $BEWEG_RICHTUNG = 1 Then
    aAnima()
    sAnima()
    EndIf
    If $BEWEG_RICHTUNG = 2 Then
    sAnima()
    EndIf
    If $BEWEG_RICHTUNG = 4 Then
    wAnima()
    aAnima()
    sAnima()
    EndIf
    EndFunc

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

    Func dAnimaD()
    If $BEWEG_RICHTUNG = 1 Then
    aAnima()
    sAnima()
    dAnima()
    EndIf
    If $BEWEG_RICHTUNG = 2 Then
    sAnima()
    dAnima()
    EndIf
    If $BEWEG_RICHTUNG = 3 Then
    dAnima()
    EndIf
    EndFunc

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

    Func openmap()
    _GDIPlus_GraphicsDrawImage($hBitmap_Backbuffer, $hGr_Map, 0, 0)
    EndFunc

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

    Func _openmap()
    Local $aArray[1]
    _FileReadToArray(@ScriptDir&"\maps\sclucht.map",$aArray)
    For $x = 1 To $aArray[0] Step 1
    $ss = StringSplit($aArray[$x]," ")
    $q = StringSplit($ss[2],";")
    If $ss[1] = "Gras" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,0,0,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "Gravel" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,32,0,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "Stein" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,64,0,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "Wasser" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,0,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserRL" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,160,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserRR" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,192,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserRU" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,224,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserRO" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,256,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserELO" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,32,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserELU" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,64,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserERO" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,128,32,32,$q[1],$q[2],32,32)
    EndIf
    If $ss[1] = "WasserERU" Then
    _GDIPlus_GraphicsDrawImageRectRect($hGr_Map,$SPS,96,96,32,32,$q[2],$q[2],32,32)
    EndIf
    Next
    EndFunc

    [/autoit]

    Über Hilfe würde ich mich sehr freuen ! :thumbup:

  • Problem mit Liste

    • F4R
    • 20. Juli 2013 um 17:23

    Hallo Leute,
    Ich wollte einen Taskmanager programmieren, bis jetzt Zählt er alle Prozesse sauber in einer Liste auf,
    aber ich möchte noch ein paar Funktionen hinzufügen und dazu muss ich wissen welcher Prozess in dieser
    erstellten Liste angewählt ist. Leider fällt mir mit meinem Wissen noch keine Lösung ein...

    Hier mal der Code:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>

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

    $Form1 = GUICreate("Taskmanager", 315, 498, 473, 58)
    $List1 = GUICtrlCreateList("", 0, 0, 313, 422)
    $Button1 = GUICtrlCreateButton("Start", 8, 432, 75, 25)
    $Button2 = GUICtrlCreateButton("Leeren", 120, 432, 75, 25)
    $Button3 = GUICtrlCreateButton("Beenden", 224, 432, 75, 25)
    $Label1 = GUICtrlCreateLabel("", 8, 472, 300, 17)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $list = ProcessList()
    GUICtrlSetData($List1,"")
    GUICtrlSetData($Label1,"Anzahl der Prozesse:" & $list[0][0])
    _start()
    _GUICtrlListBox_Sort($List1)
    Case $Button2
    GUICtrlSetData($List1,"")
    Case $Button3
    Exit
    EndSwitch
    WEnd

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

    Func _start()
    Local $list = ProcessList()
    For $i = 1 To $list[0][0]
    $Read = GUICtrlRead($List1)
    GUICtrlSetData($List1,$Read & $list[$i][0] &" PID :" & $list[$i][1])
    Next
    EndFunc

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

    Mfg F4R :D

  • Binäruhr

    • F4R
    • 1. Mai 2013 um 22:03

    Super Sache ! Das langsame Ausblenden ist echt genial :)

  • Textdatei schreiben und lesen (definierte stelle)

    • F4R
    • 26. April 2013 um 16:08

    Vielleicht solltest du dir mal den Koda Form-Designer ansehen.
    Damit kannst du sehr leicht GUI's und Textfelder erstellen.

    Mfg F4R

  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 22:51

    Ich habe die Variablen geändert, aber irgendwie Funktioniert jetzt gar nichts mehr ?(
    Irgendwas ist Falsch ich weis aber nicht was...

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.8.0
    Author: F4R

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

    Script Function: Pong
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    Global $iHeight1 = 70
    Global $iWidth1 = 20
    Global $iY1 = 100
    Global $iX1 = 15

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

    Global $iHeight2 = 5
    Global $iWidth2 = 5
    Global $iX2 = 10
    Global $iY2 = 100

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

    Global $sleep = 100

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

    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Pong", 625, 443, 192, 124)
    GUISetBkColor(0x000000)
    Global $Graphic1 = GUICtrlCreateGraphic($iX1, $iY1, $iWidth1, $iHeight1)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic2 = GUICtrlCreateGraphic(540, 100, 20, 70)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic3 = GUICtrlCreateGraphic($iX2, $iY2, $iWidth2, $iHeight2)
    GUICtrlSetBkColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    HotKeySet("{UP}", "up")
    HotKeySet("{down}", "down")

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

    While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit

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

    $ret = _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    If $ret = True Then
    rechts()
    EndIf
    links()
    WEnd

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

    Func up()
    $iY1 = $iY1 - 10
    GUICtrlSetPos($Graphic1, 10, $iY1)
    If $iY1 = -10 Then
    $iY1 = $iY1 + 10
    EndIf
    EndFunc ;==>up

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

    Func down()
    $iY1 = $iY1 + 10
    GUICtrlSetPos($Graphic1, 10, $iY1)
    If $iY1 = 400 Then
    $iY1 = $iY1 - 10
    EndIf
    EndFunc ;==>down

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

    Func links()
    $iX2 = Random(0, 450, 1)
    Do
    $iY2 = $iY2 - 10
    Sleep($sleep)
    GUICtrlSetPos($Graphic3, $iY2, $iX2)
    Until $iY2 = 20
    EndFunc ;==>links

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

    Func rechts()
    $iX2 = Random(0, 450, 1)
    GUICtrlSetPos($Graphic2, 540, $iX2 - 20)
    Do
    $iY2 = $iY2 + 10
    GUICtrlSetPos($Graphic3, $iY2, $iX2)
    Sleep($sleep)
    Until $iY2 = 530
    EndFunc ;==>rechts

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

    Func _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    ;Author: Faweyr

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

    Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2

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

    EndFunc ;==>_RectCollision

    [/autoit]
  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 21:47

    Ich weis :D Ich hab das nur als 2. Bestätigung geschrieben das das Thema gelöst ist...

  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 21:37

    Danke für die Hilfe ich glaube verstanden zu haben was du meinst xD
    Damit hat sich das Thema erledigt...

    *close*

  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 19:58

    Bei Funktioniert es auch so, aber wenn man den Ball nicht Trifft geht das Spiel Trotzdem weiter...
    Desswegen ja die Kolisionsabfrage :)
    Und Danke für die vielen Tipps zur verbesserung !

  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 15:46

    Ich bin noch nicht lang hier angemeldet, aber Danke für den Hinweis :)

  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 29. März 2013 um 14:40

    Andy ich habe versucht deine 1. Methode einzubauen aber irgendwie muss ich noch etwas verändern damit es Funktioniert kannst du dir
    Bitte den Skript nochmal anschauen und mir sagen was ich falsch gemacht habe , oder noch ändern muss

    Mfg F4R

    Spoiler anzeigen
    [autoit]

    Global $iHeight1 = 70
    Global $iWidth1 = 20
    Global $iY1 = 10
    Global $iX1 = 100

    [/autoit]


    Global $iHeight2 = 9
    Global $iWidth2 = 9
    Global $iX2 = 100
    Global $iY2 = 10

    Global $sleep = 100
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Pong", 625, 443, 192, 124)
    GUISetBkColor(0x000000)
    Global $Graphic1 = GUICtrlCreateGraphic($iY1, $iX1, $iWidth1, $iHeight1)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic2 = GUICtrlCreateGraphic(540, 100, 20, 70)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic3 = GUICtrlCreateGraphic($iY2, $iX2, $iWidth2, $iHeight2)
    GUICtrlSetBkColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    HotKeySet("{UP}","up")
    HotKeySet("{down}","down")
    While 1
    $msg = GUIGetMsg()
    IF $msg = -3 Then Exit

    _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    rechts()
    links()

    WEnd


    Func up()
    $iX1 = $iX1 -10
    GUICtrlSetPos($Graphic1,10,$iX1)
    If $iX1 = -10 Then
    $iX1 = $iX1 +10
    EndIf
    EndFunc


    Func down()
    $iX1 = $iX1 +10
    GUICtrlSetPos($graphic1,10,$iX1)
    If $iX1 = 400 Then
    $iX1 = $iX1 -10
    EndIf
    EndFunc

    Func links()
    $iY2 = Random(0,450,1)
    Do
    $iX2 = $iX2 - 10
    Sleep($sleep)
    GUICtrlSetPos($Graphic3,$iX2,$iY2)
    Until $iX2 = 20
    EndFunc


    Func rechts()
    $iY2 = Random(0,450,1)
    GUICtrlSetPos($Graphic2,540,$iY2 - 20)
    Do
    $iX2 = $iX2 + 10
    GUICtrlSetPos($Graphic3,$iX2,$iY2)
    Sleep($sleep)
    Until $iX2 = 530
    EndFunc

    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][/autoit][autoit][/autoit][autoit][/autoit]
  • Kolisionsabfrage von einem Quadrat und Rechteck

    • F4R
    • 28. März 2013 um 23:55

    Ich wollte ein kleines Game machen und mir fehlt die Kolisionsabfrage, die ich nicht hinbekomme !

    Spoiler anzeigen
    [autoit]


    Global $pos = 50
    Global $pos1 = 20

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

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 443, 192, 124)
    GUISetBkColor(0x000000)
    Global $Graphic1 = GUICtrlCreateGraphic(10, 100, 20, 70)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic2 = GUICtrlCreateGraphic(540, 100, 20, 70)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    Global $Graphic3 = GUICtrlCreateGraphic(10, 100, 9, 9)
    GUICtrlSetBkColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    HotKeySet("{UP}","up")
    HotKeySet("{down}","down")
    While 1
    $msg = GUIGetMsg()
    IF $msg = -3 Then Exit
    ;============================== Kolisionsabfrage==========================

    rechts()
    links()

    WEnd

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

    Func up()
    $pos = $pos -10
    GUICtrlSetPos($Graphic1,10,$pos)
    If $pos = -10 Then
    $pos = $pos +10
    EndIf
    EndFunc

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

    Func down()
    $pos = $pos +10
    GUICtrlSetPos($graphic1,10,$pos)
    If $pos = 400 Then
    $pos = $pos -10
    EndIf
    EndFunc

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

    Func links()
    $random = Random(0,450,1)
    Do
    $pos1 = $pos1 - 10
    Sleep(100)
    GUICtrlSetPos($Graphic3,$pos1,$random)
    Until $pos1 = 20
    EndFunc

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

    Func rechts()
    $random = Random(0,450,1)
    GUICtrlSetPos($Graphic2,540,$random - 20)
    Do
    $pos1 = $pos1 + 10
    GUICtrlSetPos($Graphic3,$pos1,$random)
    Sleep(100)
    Until $pos1 = 530
    EndFunc

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

    Ich hoffe ihr könnt mir weiterhelfen...

  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 14:03

    Danke funktioniert Perfekt!

    Großes Dankeschön an alle die mir geholfen haben ! :thumbup:

  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 13:55

    Ich glaube ich geh euch langsam auf die Nerven aber
    mein Zähler zählt nur bis 1 und nicht weiter ?(

    [autoit]

    While 1

    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
    $random = Random(0, 45, 1)
    $d = (0+$e)*14-($random*10+$pos)*14
    $p = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, $random*10, 28, 28, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    Do
    $pos = $pos - 10
    GUICtrlSetPos($p, $pos)
    Sleep($sleep)
    Until $pos = 0

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

    $round = $round + 1

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

    $pos = 800

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

    If $sleep > 10 Then
    $sleep = $sleep - 10
    EndIf
    Local $count = 0

    If $d < 20 Then
    GUICtrlDelete($p)
    $count = $count + 1
    GUICtrlSetData($label1,$count)
    EndIf
    WEnd

    [/autoit]
  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 13:32

    Ich hab es hin bekommen!
    Danke an die schnelle Hilfe :thumbup:

    [autoit]

    $d = (0+$e)*14-($random*10+$pos)*14

    [/autoit]
  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 13:26

    Ich weis nicht ob das so richtig ist ?(

    [autoit]

    $d = Sqrt( (0-$e)^2 + ($random*10-800)^2 )
    If $d < 10 Then
    GUICtrlDelete($p)
    $count = $count + 1
    EndIf

    [/autoit]
  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 13:09

    Jetzt brauch ich nur noch das Punktesystem, was ja mein eigentliches Problem war...
    Also dass der Gegenstand nicht um 100% mit der Koordinate von dem krokodil übereinstimmt
    aber trotzdem erkannt wird :)
    Sowas wie :

    [autoit]

    If $pos = $e Then
    $count = $count + 1

    [/autoit]
  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 12:56

    Hätte man mir das früher gesagt.... hab ne ewigkeit damit verbracht das zu Kopieren und umzuschreiben :cursing:
    Aber Danke so geht es auch

  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 12:49

    Ja so ungefähr :D
    Mir fehlt nur noch das Punktesystem...

  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 12:36
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.8.0
    Author: F4R

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

    Script Function: Krokofight is a Game
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Fish", 760, 480, 264, 133)
    $Pic1 = GUICtrlCreatePic("C:\Users\Paul\Desktop\Krokodile.jpg", 0, 0, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    GUISetState(@SW_SHOW)
    GUISetBkColor(0xFFFFFF)
    #EndRegion ### END Koda GUI section ###

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

    HotKeySet("{up}","up")
    HotKeySet("{down}","down")
    Global $pos = 800

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

    Local $e = 0
    Func up()
    $e = $e -10
    GUICtrlSetPos($pic1,1,$e)
    If $e = 450 Then
    $e = $e -10
    EndIf
    If $e = 0 Then
    $e = $e +10
    EndIf
    EndFunc

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

    Local $e = 0
    Func down()
    $e = $e +10
    GUICtrlSetPos($pic1,1,$e)
    If $e = 450 Then
    $e = $e -10
    EndIf
    If $e = 10 Then
    $e = $e +10
    EndIf
    EndFunc
    Local $sleep = 100
    Local $round = 0
    While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
    $random = Random(1,46,1)

    If $random = 1 Then
    $p1 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 0, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p1,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p1)
    EndIf
    If $random = 2 Then
    $p2 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 10, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p2,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p2)

    EndIf
    If $random = 3 Then
    $p3 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 20, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p3,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p3)

    EndIf
    If $random = 4 Then
    $p4 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 30, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p4,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p4)

    EndIf
    If $random = 5 Then
    $p5 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 40, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p5,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p5)

    EndIf
    If $random = 6 Then
    $p6 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 50, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p6,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p6)

    EndIf
    If $random = 7 Then
    $p7 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 60, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p7,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p7)

    EndIf
    If $random = 8 Then
    $p8 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 70, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p8,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p8)

    EndIf
    If $random = 9 Then
    $p9 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 80, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p9,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p9)

    EndIf
    If $random = 10 Then
    $p10 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 90, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p10,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p10)

    EndIf
    If $random = 11 Then
    $p11 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 100, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p11,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p11)

    EndIf
    If $random = 12 Then
    $p12 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 110, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p12,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p12)

    EndIf
    If $random = 13 Then
    $p13 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 120, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p13,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p13)

    EndIf
    If $random = 14 Then
    $p14 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 130, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p14,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p14)

    EndIf
    If $random = 15 Then
    $p15 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 140, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p15,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p15)

    EndIf
    If $random = 16 Then
    $p16 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 150, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p16,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p16)

    EndIf
    If $random = 17 Then
    $p17 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 160, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p17,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p17)

    EndIf
    If $random = 18 Then
    $p18 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 170, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p18,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p18)

    EndIf
    If $random = 19 Then
    $p19 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 180, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p19,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p19)

    EndIf
    If $random = 20 Then
    $p20 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 190, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p20,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p20)

    EndIf
    If $random = 21 Then
    $p21 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 200, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p21,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p21)

    EndIf
    If $random = 22 Then
    $p22 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 210, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p22,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p22)

    EndIf
    If $random = 23 Then
    $p23 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 220, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p23,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p23)

    EndIf
    If $random = 24 Then
    $p24 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 230, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p24,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p24)

    EndIf

    If $random = 25 Then
    $p25 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 240, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p25,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p25)

    EndIf
    If $random = 26 Then
    $p26 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 250, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p26,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p26)

    EndIf
    If $random = 27 Then
    $p27 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 260, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p27,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p27)

    EndIf
    If $random = 28 Then
    $p28 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 270, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p28,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p28)

    EndIf
    If $random = 29 Then
    $p29 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 280, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p29,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p29)

    EndIf
    If $random = 30 Then
    $p30 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 290, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p30,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p30)

    EndIf
    If $random = 31 Then
    $p31 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 300, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p31,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p31)

    EndIf
    If $random = 32 Then
    $p32 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 310, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p32,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p32)

    EndIf
    If $random = 33 Then
    $p33 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 320, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p33,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p33)

    EndIf
    If $random = 34 Then
    $p34 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 330, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p34,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p34)

    EndIf
    If $random = 35 Then
    $p35 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 340, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p35,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p35)

    EndIf
    If $random = 36 Then
    $p36 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 350, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p36,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p36)

    EndIf
    If $random = 37 Then
    $p37 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 360, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p37,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p37)

    EndIf
    If $random = 38 Then
    $p38 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 370, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p38,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p38)

    EndIf
    If $random = 39 Then
    $p39 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 380, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p39,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p39)

    EndIf
    If $random = 40 Then
    $p40 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 390, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p40,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p40)

    EndIf
    If $random = 41 Then
    $p41 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 400, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p41,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p41)

    EndIf
    If $random = 42 Then
    $p42 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 410, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p42,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p42)

    EndIf
    If $random = 43 Then
    $p43 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 420, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p43,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p43)

    EndIf
    If $random = 44 Then
    $p44 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 430, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p44,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p44)

    EndIf
    If $random = 45 Then
    $p45 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 440, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p45,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p45)

    EndIf
    If $random = 46 Then
    $p46 = GUICtrlCreatePic("C:\Users\Paul\Desktop\feind.jpg", 800, 450, 28, 28, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    Do
    $pos = $pos -10
    GUICtrlSetPos($p46,$pos)
    Sleep($sleep)
    Until $pos = 0
    GUICtrlDelete($p46)

    EndIf
    If $pos = $e Then Exit
    $round = $round + 1

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

    $pos = 800

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

    If $sleep > 10 Then
    $sleep = $sleep -10
    EndIf

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

    WEnd

    [/autoit]


    Mein Problem ist, dass ich noch schreiben muss wie die Gegenstände gezählt werden die man eingesammelt hat :D

  • Problem mit einem Spiel

    • F4R
    • 28. März 2013 um 11:56

    Kurz gesagt geht es in meinem Spiel darum Gegenstände einzusammeln. Ich habe aber das Problem
    Das die Koordinaten der Gegenstände immer Passend sein müssen zu der Spielfigur die sie
    einsammelt, aber die Figur soll sie auch einsammeln wenn es eben eine Abweichung von 10-9 Pixeln gibt.
    Zu diesem Thema gab es schon einen Beitrag doch ich bin nicht so der Überflieger in AutoIT.
    Dort wurde geraten mit Switch zu Arbeiten, aber ich habe das irgendwie nicht verstadnen...

    Ich hoffe ihr könnt mir weiterhelfen.
    Mfg F4R :)

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™