So, endlich ist meine UDF in Aufbau und weit
Hier ist mal ein auszug des alten Scripts:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
HotKeySet("{ESC}", "_Exit")
HotKeySet("{SPACE}", "_Talk")
_GDIPlus_Startup()
Global $GUIWidth = 450, $GUIHeight = 250
Global $Link = 1
Global $Talk = 0
; _GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageKiste, $KistePos1, $KistePos2, 25, 25) ;Trägt Kiste in Buffer ein
; _GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageKiste, $KistePos1, $KistePos2, 25, 25) ; Trägt Kiste auch ein
Global $MunzeZahl = 0
Global $ImageFileHintergrund = @ScriptDir&"\Hintergrund450x250.PNG"
Global $ImageFileLinkUnten = @ScriptDir&"\LinkUnten.PNG"
Global $ImageFileLinkOben = @ScriptDir&"\LinkOben.PNG"
Global $ImageFileLinkRechts = @ScriptDir&"\LinkRechts.PNG"
Global $ImageFileLinkLinks = @ScriptDir&"\LinkLinks.PNG"
Global $ImageFileKiste = @ScriptDir&"\Kiste.PNG"
Global $ImageFileMunze = @ScriptDir&"\Munze.PNG"
Global $ImageFileMunzeAnzahl0 = @ScriptDir&"\Munze03.PNG"
Global $ImageFileMunzeAnzahl1 = @ScriptDir&"\Munze13.PNG"
Global $ImageFileMunzeAnzahl2 = @ScriptDir&"\Munze23.PNG"
Global $ImageFileMunzeAnzahl3 = @ScriptDir&"\Munze33.PNG"
Global $ImageFileZiel = @ScriptDir&"\Ziel.PNG"
Global $ImageFileText = @ScriptDir&"\TextFeld400x50.png"
Global $ImageFileNpc1 = @ScriptDir&"\NPC1 25x34.PNG"
Global $PosAktuell1 = 25 ;X von Link
Global $PosAktuell2 = 25 ;Y von Link
Global $KistePos1 = 100 ;Später für Kiste X
Global $KistePos2 = 25 ;Später für Kiste Y
Global $Munze1Pos1 = 200
Global $Munze1Pos2 = 50
Global $Munze2Pos1 = 300
Global $Munze2Pos2 = 100
Global $Munze3Pos1 = 400
Global $Munze3Pos2 = 200
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Zeichen Papier", 450, 250, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Graphic= _GDIPlus_GraphicsCreateFromHWND($Form1) ;Frontbuffer
$Bitmap= _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $Graphic) ;Bitmap für Frontbuffer
$Backbuffer = _GDIPlus_ImageGetGraphicsContext($Bitmap) ;Backbuffer
$ImageHintergrund = _GDIPlus_ImageLoadFromFile($ImageFileHintergrund)
$ImageLinkUnten = _GDIPlus_ImageLoadFromFile($ImageFileLinkUnten)
$ImageLinkOben = _GDIPlus_ImageLoadFromFile($ImageFileLinkOben)
$ImageLinkRechts = _GDIPlus_ImageLoadFromFile($ImageFileLinkRechts)
$ImageLinkLinks = _GDIPlus_ImageLoadFromFile($ImageFileLinkLinks)
$ImageKiste = _GDIPlus_ImageLoadFromFile($ImageFileKiste)
$ImageMunze = _GDIPlus_ImageLoadFromFile($ImageFileMunze)
$ImageMunzeAnzahl0 = _GDIPlus_ImageLoadFromFile($ImageFileMunzeAnzahl0)
$ImageMunzeAnzahl1 = _GDIPlus_ImageLoadFromFile($ImageFileMunzeAnzahl1)
$ImageMunzeAnzahl2 = _GDIPlus_ImageLoadFromFile($ImageFileMunzeAnzahl2)
$ImageMunzeAnzahl3 = _GDIPlus_ImageLoadFromFile($ImageFileMunzeAnzahl3)
$ImageZiel = _GDIPlus_ImageLoadFromFile($ImageFileZiel)
$ImageText = _GDIPlus_ImageLoadFromFile($ImageFileText)
$ImageNPC1 = _GDIPlus_ImageLoadFromFile($ImageFileNpc1)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageHintergrund,0,0, $GUIWidth, $GUIHeight)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageLinkUnten, $PosAktuell1, $PosAktuell2, 25, 34)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $PosAktuell1, $PosAktuell2, 25, 34)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl0, 0, 0, 25, 34)
;Münzen
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $GUIWidth, $GUIHeight) ; Back to front Buffer
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If _IsPressed("25") Then
$Link = 4
_LinksDraw()
EndIf
If _IsPressed("27") Then
$Link = 3
_RechtsDraw()
EndIf
If _IsPressed("28") Then
$Link = 1
_UntenDraw()
EndIf
If _IsPressed("26") Then
$Link = 2
_ObenDraw()
EndIf
_ReDraw()
WEnd
Func _Exit()
GUISetState(@SW_HIDE)
Exit
_GDIPlus_ImageDispose($ImageHintergrund)
_GDIPlus_ImageDispose($ImageLinkUnten)
_GDIPlus_ImageDispose($ImageLinkOben)
_GDIPlus_ImageDispose($ImageLinkRechts)
_GDIPlus_ImageDispose($ImageLinkLinks)
_GDIPlus_ImageDispose($ImageKiste)
_GDIPlus_ImageDispose($ImageMunze)
_GDIPlus_ImageDispose($ImageMunzeAnzahl0)
_GDIPlus_ImageDispose($ImageMunzeAnzahl1)
_GDIPlus_ImageDispose($ImageMunzeAnzahl2)
_GDIPlus_ImageDispose($ImageMunzeAnzahl3)
_GDIPlus_ImageDispose($ImageText)
_GDIPlus_ImageDispose($ImageZiel)
_GDIPlus_GraphicsDispose($Backbuffer)
_GDIPlus_BitmapDispose($Bitmap)
_GDIPlus_GraphicsDispose($Graphic)
_GDIPlus_Shutdown()
EndFunc
Func _ReDraw()
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageHintergrund,0,0, $GUIWidth, $GUIHeight)
Switch $Link
Case 1
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageLinkUnten, $PosAktuell1 ,$PosAktuell2, 25, 34)
Case 2
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageLinkOben, $PosAktuell1 ,$PosAktuell2, 25, 34)
Case 3
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageLinkRechts, $PosAktuell1 ,$PosAktuell2, 25, 34)
Case 4
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageLinkLinks, $PosAktuell1 ,$PosAktuell2, 25, 34)
EndSwitch
Switch $MunzeZahl
Case 0
If ($PosAktuell1 >= $Munze1Pos1-25 and $PosAktuell1 <= $Munze1Pos1+25) and ($PosAktuell2 >= $Munze1Pos2-25 and $PosAktuell2 <= $Munze1Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 1
ElseIf ($PosAktuell1 >= $Munze2Pos1-25 and $PosAktuell1 <= $Munze2Pos1+25) and ($PosAktuell2 >= $Munze2Pos2-25 and $PosAktuell2 <= $Munze2Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 2
ElseIf ($PosAktuell1 >= $Munze3Pos1-25 and $PosAktuell1 <= $Munze3Pos1+25) and ($PosAktuell2 >= $Munze3Pos2-25 and $PosAktuell2 <= $Munze3Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
$MunzeZahl = 3
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl0, 346, 0, 104, 23)
Case 1 ;Münze 1 ist bereits aufgesammelt
If ($PosAktuell1 >= $Munze2Pos1-25 and $PosAktuell1 <= $Munze2Pos1+25) and ($PosAktuell2 >= $Munze2Pos2-25 and $PosAktuell2 <= $Munze2Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 12 ;Münze 1 + 2
ElseIf ($PosAktuell1 >= $Munze3Pos1-25 and $PosAktuell1 <= $Munze3Pos1+25) and ($PosAktuell2 >= $Munze3Pos2-25 and $PosAktuell2 <= $Munze3Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
$MunzeZahl = 13 ;Münze 1 + 3
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl1, 346, 0, 104, 23)
Case 2 ;Münze 2 ist bereits aufgesammelt
If ($PosAktuell1 >= $Munze1Pos1-25 and $PosAktuell1 <= $Munze1Pos1+25) and ($PosAktuell2 >= $Munze1Pos2-25 and $PosAktuell2 <= $Munze1Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 21 ;Münze 2 + 1
ElseIf ($PosAktuell1 >= $Munze3Pos1-25 and $PosAktuell1 <= $Munze3Pos1+25) and ($PosAktuell2 >= $Munze3Pos2-25 and $PosAktuell2 <= $Munze3Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
$MunzeZahl = 23 ;Münze 2 + 3
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl1, 346, 0, 104, 23)
Case 3 ;Münze 3 ist bereits aufgesammelt
If ($PosAktuell1 >= $Munze1Pos1-25 and $PosAktuell1 <= $Munze1Pos1+25) and ($PosAktuell2 >= $Munze1Pos2-25 and $PosAktuell2 <= $Munze1Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 31 ;Münze 3 + 1
ElseIf ($PosAktuell1 >= $Munze2Pos1-25 and $PosAktuell1 <= $Munze2Pos1+25) and ($PosAktuell2 >= $Munze2Pos2-25 and $PosAktuell2 <= $Munze2Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 32 ;Münze 3 + 2
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl1, 346, 0, 104, 23)
Case 12 ;Münze 1 + 2 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze3Pos1-25 and $PosAktuell1 <= $Munze3Pos1+25) and ($PosAktuell2 >= $Munze3Pos2-25 and $PosAktuell2 <= $Munze3Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
$MunzeZahl = 123 ; 1 + 2 + 3
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 13 ;Münze 1 + 3 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze2Pos1-25 and $PosAktuell1 <= $Munze2Pos1+25) and ($PosAktuell2 >= $Munze2Pos2-25 and $PosAktuell2 <= $Munze2Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 123
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 21 ;Münze 2 + 1 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze3Pos1-25 and $PosAktuell1 <= $Munze3Pos1+25) and ($PosAktuell2 >= $Munze3Pos2-25 and $PosAktuell2 <= $Munze3Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
$MunzeZahl = 123
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 23 ;Münze 2 + 3 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze1Pos1-25 and $PosAktuell1 <= $Munze1Pos1+25) and ($PosAktuell2 >= $Munze1Pos2-25 and $PosAktuell2 <= $Munze1Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 123
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 31 ;Münze 3 + 1 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze2Pos1-25 and $PosAktuell1 <= $Munze2Pos1+25) and ($PosAktuell2 >= $Munze2Pos2-25 and $PosAktuell2 <= $Munze2Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 123
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 32 ;Münze 3 + 2 sind bereits aufgesammelt
If ($PosAktuell1 >= $Munze1Pos1-25 and $PosAktuell1 <= $Munze1Pos1+25) and ($PosAktuell2 >= $Munze1Pos2-25 and $PosAktuell2 <= $Munze1Pos2+25) Then
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze2Pos1, $Munze2Pos2, 25, 25)
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze3Pos1, $Munze3Pos2, 25, 25)
$MunzeZahl = 123
Else
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunze, $Munze1Pos1, $Munze1Pos2, 25, 25)
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl2, 346, 0, 104, 23)
Case 123
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageZiel, 25, 25, 24, 32)
If $PosAktuell1 <= 49 and $PosAktuell2 <= 57 Then
MsgBox(0, "Herzlichen Glückwunsch !", "Du hast das Spiel von EliteMattthias erfolgreich bewältigt !")
_Exit()
EndIf
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageMunzeAnzahl3, 346, 0, 104, 23)
EndSwitch
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageNPC1, 400, 25, 25, 34)
Switch $Talk
Case 1
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageText, 25, 174, 400, 50)
_GDIPlus_GraphicsDrawString($Backbuffer, "Hallo mein Freund !", 45, 180)
Case 2
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageText, 25, 174, 400, 50)
_GDIPlus_GraphicsDrawString($Backbuffer, "Du spielst also das Spiel"&@CRLF&"von EliteMattthias ?", 45, 180)
EndSwitch
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $GUIWidth, $GUIHeight) ; Back to front Buffer
EndFunc
Func _LinksDraw()
If $PosAktuell1 <= 25 Then
$PosAktuell1 = 25
Else
$PosAktuell1 -= 3
EndIf
EndFunc
Func _RechtsDraw()
If $PosAktuell1 >= 400 Then
$PosAktuell1 = 400
ElseIf $PosAktuell1 <= 425 and $PosAktuell1 >= 375 and $PosAktuell2 <= 62 Then
Else
$PosAktuell1 += 3
EndIf
EndFunc
Func _ObenDraw()
If $PosAktuell2 <= 25 Then
$PosAktuell2 = 25
ElseIf $PosAktuell1 <= 425 and $PosAktuell1 >= 375 and $PosAktuell2 <= 62 Then
Else
$PosAktuell2 -= 3
EndIf
EndFunc
Func _UntenDraw()
If $PosAktuell2 >= 191 Then
$PosAktuell2 = 191
Else
$PosAktuell2 += 3
EndIf
EndFunc
Func _Talk()
If $PosAktuell1 <= 425 and $PosAktuell1 >= 375 and $PosAktuell2 <= 62 Then
Switch $Talk
Case 0
$Talk = 1
Case 1
$Talk = 2
Case 2
$Talk = 0
EndSwitch
EndIf
EndFunc
Und hier das neue:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GameUDF.au3>
_GDIPlus_Startup()
Global $GUIWidth = 450, $GUIHeight = 250
Global $Link = 1
Global $Talk = 0
Global $Laufen = 1
Global $ImageHintergrund = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\BACKGROUND.PNG")
Global $ImageLinkUnten = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\LinkUnten.PNG")
Global $ImageLinkOben = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\LinkOben.PNG")
Global $ImageLinkRechts = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\LinkRechts.PNG")
Global $ImageLinkLinks = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\LinkLinks.PNG")
Global $ImageMunze = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\Munze.PNG")
Global $ImageZiel = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\Ziel.PNG")
Global $ImageText = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\TextFeld.PNG")
Global $ImageNPC1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\NPC1.PNG")
Global $Tree = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\EDITOR\Tree.PNG")
Global $MunzeZahl = 0
Global $PosAktuell1 = 25
Global $PosAktuell2 = 25
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Domino Zelda --> Journy of GDI+", 450, 250, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Graphic = _GDIPlus_GraphicsCreateFromHWND($Form1) ;Frontbuffer
$Bitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $Graphic) ;Bitmap für Frontbuffer
$Backbuffer = _GDIPlus_ImageGetGraphicsContext($Bitmap) ;Backbuffer
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
_ReDraw()
WEnd
Func _ReDraw()
_GDIPlus_GraphicsDrawImageRect($Backbuffer, $ImageHintergrund, 0, 0, $GUIWidth, $GUIHeight)
_TreeCreate($Backbuffer, $PosAktuell1, $PosAktuell2, 200, 150, $Tree) ;UDF
_NpcCreate($Backbuffer, $PosAktuell1, $PosAktuell2, 200, 50, $ImageNPC1, "abc", $ImageText)
_MunzeCreate1($Backbuffer, $PosAktuell1, $PosAktuell2, 200, 100, $ImageMunze)
_MunzeCreate2($Backbuffer, $PosAktuell1, $PosAktuell2, 50, 150, $ImageMunze)
_MunzeCreate3($Backbuffer, $PosAktuell1, $PosAktuell2, 150, 50, $ImageMunze)
_Laufen($Backbuffer, $ImageLinkUnten, $ImageLinkOben, $ImageLinkRechts, $ImageLinkLinks)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $GUIWidth, $GUIHeight) ; Back to front Buffer
EndFunc ;==>_ReDraw
Func _Exit()
GUISetState(@SW_HIDE)
Exit
_GDIPlus_ImageDispose($ImageHintergrund)
_GDIPlus_ImageDispose($ImageLinkUnten)
_GDIPlus_ImageDispose($ImageLinkOben)
_GDIPlus_ImageDispose($ImageLinkRechts)
_GDIPlus_ImageDispose($ImageLinkLinks)
_GDIPlus_ImageDispose($ImageMunze)
_GDIPlus_ImageDispose($ImageText)
_GDIPlus_ImageDispose($ImageZiel)
_GDIPlus_GraphicsDispose($Backbuffer)
_GDIPlus_BitmapDispose($Bitmap)
_GDIPlus_GraphicsDispose($Graphic)
_GDIPlus_Shutdown()
EndFunc ;==>_Exit
Und die UDF für das neue Script:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <Misc.au3>
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" Tree UDF
;
; Author: EliteMattthias
;
; Func Name: _TreeCreate($BackBuffer, $PersonX, $PersonY, $TreeX, $TreeY, $TreeFile,[$PersonWidth, [$PersonHeight, [$TreeWidth=25,[ $TreeHeight=25]]]])
;
; Parameter(s): $BackBuffer = Backbuffer auf den der Baum gezeichnet wird
; $PersonX = Die X Position der Person (vorher in Variable definieren)
; $PersonY = Die Y Position der Person (vorher in Variable definieren)
; $TreeX = Die X-Achse wo der Baum gezeichnet werden soll
; $TreeY = Die Y-Achse wo der Baum gezeichnet werden soll
; $File = Die Datei woraus der Baum entnommen wird (muss mit _GDIPlus_ImageLoadFromFile() geöffnet werden)
;
; OPTIONAL
;
; $TreeWidth = Die Breite des Baumes (standard 25)
; $TreeHeight = Die Höhe des Baumes (standard 25)
; $PersonWidth = Die Breite der Person
; $PersonHeight = Die Höhe der Person
;
;
; Funktion: Zeichnet einen Baum für das Spiel --GDIPlus Domino - Zelda alias "ZeichenPapier"-- der als Aufhaltendes Objekt wirkt
;
; Includes: <GDIPlus.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Func _TreeCreate($BackBuffer, $PersonX, $PersonY, $TreeX, $TreeY, $TreeFile, $PersonWidth = 25, $PersonHeight = 34, $TreeWidth = 25, $TreeHeight = 25)
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $TreeFile, $TreeX, $TreeY, $TreeWidth, $TreeHeight)
If ($PersonX <= $TreeX + $TreeWidth And $PersonX + $PersonWidth - 1 >= $TreeX) and ($PersonY + $PersonHeight - 1 >= $TreeY And $PersonY <= $TreeY + $TreeHeight) Then ;Prüft ob die Person am BAUM von LINKS ist !
$PosAktuell1 = $TreeX - $PersonWidth
ElseIf ($PersonX >= $TreeX + $TreeWidth And $PersonX <= $TreeX + $TreeWidth + 3) and ($PersonY + $PersonHeight - 1 >= $TreeY And $PersonY <= $TreeY + $TreeHeight) Then ; Prüft ob die Person am BAUM von RECHTS ist !
$PosAktuell1 = $TreeX + $TreeWidth + 4
ElseIf ($PersonX >= $TreeX - $PersonWidth + 1 And $PersonX <= $TreeX + $TreeWidth) and ($PersonY <= $TreeY + 3 And $PersonY >= $TreeY - $PersonHeight - 3) Then
$PosAktuell2 = $TreeY - $PersonHeight - 3
ElseIf ($PersonX >= $TreeX - $PersonWidth + 1 And $PersonX <= $TreeX + $TreeWidth) and ($PersonY >= $TreeY + $TreeHeight + 3 And $PersonY <= $TreeY + $TreeHeight + 6) Then
$PosAktuell2 = $TreeY + $TreeHeight + 6
EndIf
EndFunc ;==>_TreeCreate
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" NPC UDF
;
; Author: EliteMattthias
;
; Func Name: _NpcCreate($BackBuffer, $PersonX, $PersonY, $NPCX, $NPCY, $NpcFile, $Text,[ $PersonWidth, [$PersonHeight, [$NpcWidth = 25, [$NpcHeight = 34]]]])
;
; Parameter(s): $BackBuffer = Backbuffer auf den der NPC gezeichnet wird
; $PersonX = Die X Position der Person (vorher in Variable definieren)
; $PersonY = Die Y Position der Person (vorher in Variable definieren)
; $NPCX = Die X-Achse wo der NPC gezeichnet werden soll
; $NPCY = Die Y-Achse wo der NPC gezeichnet werden soll
; $File = Die Datei woraus der NPC entnommen wird (muss mit _GDIPlus_ImageLoadFromFile() geöffnet werden)
; $Text = Der Text den der NPC zu sagen hat, wenn man per LEERTASTE mit ihm spricht !
;
; <--OPTIONAL-->
;
; $PersonWidth = Die Breite der Person
; $PersonHeight = Die Höhe der Person
; $NpcWidth = Die Breite des NPCs (standard 25)
; $NpcHeight = Die Höhe des NPCs (standard 34)
;
;
; Funktion: Zeichnet einen NPC für das Spiel --GDIPlus Domino - Zelda alias "ZeichenPapier"-- der als Aufhaltendes Objekt wirkt und angesprochen werden kann !
;
; Includes: <GDIPlus.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Global $Laufen
Global $TalkTimer = TimerInit()
Func _NpcCreate($BackBuffer, $PersonX, $PersonY, $NPCX, $NPCY, $NpcFile, $Text, $TextAreaFile, $PersonWidth = 25, $PersonHeight = 34, $NpcWidth = 25, $NpcHeight = 34)
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $NpcFile, $NPCX, $NPCY, $NpcWidth, $NpcHeight)
If ($PersonX <= $NPCX + $NpcWidth And $PersonX + $PersonWidth - 1 >= $NPCX) and ($PersonY + $PersonHeight - 1 >= $NPCY And $PersonY <= $NPCY + $NpcHeight) Then ;Prüft ob die Person am BAUM von LINKS ist !
$PosAktuell1 = $NPCX - $PersonWidth
If _IsPressed("20") Then
$Laufen = 0
$Talk = 1
EndIf
ElseIf ($PersonX >= $NPCX + $NpcWidth And $PersonX <= $NPCX + $NpcWidth + 3) and ($PersonY + $PersonHeight - 1 >= $NPCY And $PersonY <= $NPCY + $NpcHeight) Then ; Prüft ob die Person am BAUM von RECHTS ist !
If _IsPressed("20") Then
$Laufen = 0
$Talk = 1
EndIf
$PosAktuell1 = $NPCX + $NpcWidth + 4
ElseIf ($PersonX >= $NPCX - $PersonWidth + 1 And $PersonX <= $NPCX + $NpcWidth) and ($PersonY <= $NPCY + 3 And $PersonY >= $NPCY - $PersonHeight - 3) Then
If _IsPressed("20") Then
$Laufen = 0
$Talk = 1
EndIf
$PosAktuell2 = $NPCY - $PersonHeight - 3
ElseIf ($PersonX >= $NPCX - $PersonWidth + 1 And $PersonX <= $NPCX + $NpcWidth) and ($PersonY >= $NPCY + $NpcHeight + 3 And $PersonY <= $NPCY + $NpcHeight + 6) Then
If _IsPressed("20") Then
$Laufen = 0
$Talk = 1
EndIf
$PosAktuell2 = $NPCY + $NpcHeight + 6
EndIf
Switch $Talk
Case 1
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $TextAreaFile, 26, 175, 400, 50)
_GDIPlus_GraphicsDrawString($BackBuffer, $Text, 43, 178)
If _IsPressed("20") And TimerDiff($TalkTimer) >= 500 Then
$TalkTimer = TimerInit()
$Talk = 0
$Laufen = 1
EndIf
EndSwitch
EndFunc ;==>_NpcCreate
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" Laufen UDF
;
; Author: EliteMattthias
;
; Func Name: _Laufen($BackBuffer, $LinkUnten, $LinkOben, $LinkRechts, $LinkLinks)
;
; Parameter(s): $BackBuffer = Backbuffer auf den Link gezeichnet wird
; $LinkUnten = Image das Link nach unten laufend darstellt
; $LinkOben = Image das Link nach oben laufend darstellt
; $LinkRechts = Image das Link nach rechts laufend darstellt
; $LinkLinks = Image das Link nach rechts laufend darstellt
;
;
; <--OPTIONAL-->
;
; $LinkWidth = Die Breite von Link (standard 25)
; $LinkHeight = Die Höhe von Link (standard 34)
;
;
; Funktion: Zum laufen des Spielcharakters in --GDIPlus Domino - Zelda alias "ZeichenPapier"-- !
;
; Includes: <GDIPlus.au3>
; <Misc.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Global $Laufen
Global $Link
Func _Laufen($BackBuffer, $LinkUnten, $LinkOben, $LinkRechts, $LinkLinks, $LinkWidth = 25, $LinkHeight = 34)
Switch $Laufen
Case 0
Case 1
If _IsPressed("25") Then
$PosAktuell1 -= 3
$Link = "Links"
EndIf
If _IsPressed("27") Then
$PosAktuell1 += 3
$Link = "Rechts"
EndIf
If _IsPressed("28") Then
$PosAktuell2 += 3
$Link = "Unten"
EndIf
If _IsPressed("26") Then
$PosAktuell2 -= 3
$Link = "Oben"
EndIf
EndSwitch
Switch $Link
Case "Unten"
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $LinkUnten, $PosAktuell1, $PosAktuell2, $LinkWidth, $LinkHeight)
Case "Oben"
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $LinkOben, $PosAktuell1, $PosAktuell2, $LinkWidth, $LinkHeight)
Case "Rechts"
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $LinkRechts, $PosAktuell1, $PosAktuell2, $LinkWidth, $LinkHeight)
Case "Links"
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $LinkLinks, $PosAktuell1, $PosAktuell2, $LinkWidth, $LinkHeight)
EndSwitch
EndFunc ;==>_Laufen
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" Laufen UDF
;
; Author: EliteMattthias
;
; Func Name: _MunzeCreate($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze,[ $PersonWidth = 25,[ $PersonHeight = 34,[ $MunzeWidth = 25,[ $MunzeHeight = 25]]]])
;
; Parameter(s): $BackBuffer = Backbuffer auf den die Münze gezeichnet wird
; $PersonX = Die X Position der Person (vorher in Variable definieren)
; $PersonY = Die Y Position der Person (vorher in Variable definieren)
; $MünzeX = Die X Position der Münze
; $MünzeY = Die Y Position der Münze
; $ImageMunze = Das Bild der Münze, geöffnet durch _GDIPlus_ImageLoadFromFile()
;
;
; <--OPTIONAL-->
;
; $PersonWidth = Die Breite der Person
; $PersonHeight = Die Höhe der Person
; $MünzeWidth = Die Breite der Münze
; $MünzeHeight = Die Höhe der Münze
;
;
; Funktion: Zum laufen des Spielcharakters in --GDIPlus Domino - Zelda alias "ZeichenPapier"-- !
;
; Includes: <GDIPlus.au3>
; <Misc.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Global $MunzeGesamt
Global $Munze1 = 0
Func _MunzeCreate1($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze, $PersonWidth = 25, $PersonHeight = 34, $MunzeWidth = 25, $MunzeHeight = 25)
If ($PersonX <= $MunzeX + $MunzeWidth And $PersonX + $PersonWidth - 1 >= $MunzeX) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze1 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX + $MunzeWidth And $PersonX <= $MunzeX + $MunzeWidth + 3) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze1 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY <= $MunzeY + 3 And $PersonY >= $MunzeY - $PersonHeight - 3) Then
$Munze1 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY >= $MunzeY + $MunzeHeight + 3 And $PersonY <= $MunzeY + $MunzeHeight + 6) Then
$Munze1 = 1
$MunzeGesamt += 1
EndIf
Switch $Munze1
Case 0
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
Case 1
$MunzeX = -25
$MunzeY = -25
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
EndSwitch
EndFunc ;==>_MunzeCreate1
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" Laufen UDF
;
; Author: EliteMattthias
;
; Func Name: _MunzeCreate($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze,[ $PersonWidth = 25,[ $PersonHeight = 34,[ $MunzeWidth = 25,[ $MunzeHeight = 25]]]])
;
; Parameter(s): $BackBuffer = Backbuffer auf den die Münze gezeichnet wird
; $PersonX = Die X Position der Person (vorher in Variable definieren)
; $PersonY = Die Y Position der Person (vorher in Variable definieren)
; $MünzeX = Die X Position der Münze
; $MünzeY = Die Y Position der Münze
; $ImageMunze = Das Bild der Münze, geöffnet durch _GDIPlus_ImageLoadFromFile()
;
;
; <--OPTIONAL-->
;
; $PersonWidth = Die Breite der Person
; $PersonHeight = Die Höhe der Person
; $MünzeWidth = Die Breite der Münze
; $MünzeHeight = Die Höhe der Münze
;
;
; Funktion: Zum laufen des Spielcharakters in --GDIPlus Domino - Zelda alias "ZeichenPapier"-- !
;
; Includes: <GDIPlus.au3>
; <Misc.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Global $MunzeGesamt
Global $Munze2 = 0
Func _MunzeCreate2($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze, $PersonWidth = 25, $PersonHeight = 34, $MunzeWidth = 25, $MunzeHeight = 25)
If ($PersonX <= $MunzeX + $MunzeWidth And $PersonX + $PersonWidth - 1 >= $MunzeX) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze2 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX + $MunzeWidth And $PersonX <= $MunzeX + $MunzeWidth + 3) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze2 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY <= $MunzeY + 3 And $PersonY >= $MunzeY - $PersonHeight - 3) Then
$Munze2 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY >= $MunzeY + $MunzeHeight + 3 And $PersonY <= $MunzeY + $MunzeHeight + 6) Then
$Munze2 = 1
$MunzeGesamt += 1
EndIf
Switch $Munze2
Case 0
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
Case 1
$MunzeX = -25
$MunzeY = -25
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
EndSwitch
EndFunc ;==>_MunzeCreate2
#cs
; UDF: GDIPlus Domino - Zelda alias "Zeichen Papier" Laufen UDF
;
; Author: EliteMattthias
;
; Func Name: _MunzeCreate($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze,[ $PersonWidth = 25,[ $PersonHeight = 34,[ $MunzeWidth = 25,[ $MunzeHeight = 25]]]])
;
; Parameter(s): $BackBuffer = Backbuffer auf den die Münze gezeichnet wird
; $PersonX = Die X Position der Person (vorher in Variable definieren)
; $PersonY = Die Y Position der Person (vorher in Variable definieren)
; $MünzeX = Die X Position der Münze
; $MünzeY = Die Y Position der Münze
; $ImageMunze = Das Bild der Münze, geöffnet durch _GDIPlus_ImageLoadFromFile()
;
;
; <--OPTIONAL-->
;
; $PersonWidth = Die Breite der Person
; $PersonHeight = Die Höhe der Person
; $MünzeWidth = Die Breite der Münze
; $MünzeHeight = Die Höhe der Münze
;
;
; Funktion: Zum laufen des Spielcharakters in --GDIPlus Domino - Zelda alias "ZeichenPapier"-- !
;
; Includes: <GDIPlus.au3>
; <Misc.au3>
;
;
; Needs: Es müssen extra Variablen für die Position des Charakters genommen werden !
; $PosAktuell1 = X
; $PosAktuell2 = Y
;
;
; (C) EliteMattthias
; All Copyrights reserved by EliteMattthias
#ce
Global $PosAktuell1
Global $PosAktuell2
Global $MunzeGesamt
Global $Munze3 = 0
Func _MunzeCreate3($BackBuffer, $PersonX, $PersonY, $MunzeX, $MunzeY, $ImageMunze, $PersonWidth = 25, $PersonHeight = 34, $MunzeWidth = 25, $MunzeHeight = 25)
If ($PersonX <= $MunzeX + $MunzeWidth And $PersonX + $PersonWidth - 1 >= $MunzeX) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze3 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX + $MunzeWidth And $PersonX <= $MunzeX + $MunzeWidth + 3) and ($PersonY + $PersonHeight - 1 >= $MunzeY And $PersonY <= $MunzeY + $MunzeHeight) Then
$Munze3 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY <= $MunzeY + 3 And $PersonY >= $MunzeY - $PersonHeight - 3) Then
$Munze3 = 1
$MunzeGesamt += 1
ElseIf ($PersonX >= $MunzeX - $PersonWidth + 1 And $PersonX <= $MunzeX + $MunzeWidth) and ($PersonY >= $MunzeY + $MunzeHeight + 3 And $PersonY <= $MunzeY + $MunzeHeight + 6) Then
$Munze3 = 1
$MunzeGesamt += 1
EndIf
Switch $Munze3
Case 0
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
Case 1
$MunzeX = -25
$MunzeY = -25
_GDIPlus_GraphicsDrawImageRect($BackBuffer, $ImageMunze, $MunzeX, $MunzeY, 25, 25)
EndSwitch
EndFunc ;==>_MunzeCreate3