Das fällt immer noch unter die Kategorie Keylogger
Zitatwieviel jemand für so eine Umsetzung verlangen würde.
So um die 3000€.
Nein im Ernst ich würde sagen du musst entscheiden wie viel du bereit bist auszugeben. ![]()
Das fällt immer noch unter die Kategorie Keylogger
Zitatwieviel jemand für so eine Umsetzung verlangen würde.
So um die 3000€.
Nein im Ernst ich würde sagen du musst entscheiden wie viel du bereit bist auszugeben. ![]()
1. Schreib kleiner!
2. Wenn du mit GDI+ arbeitest, kannst du diese Funktion verwenden:
; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapSetPixel
; Description ...: Sets the color of a specified pixel in this bitmap
; Syntax.........: _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, $iARGB)
; Parameters ....: $hBitmap - Pointer to the Bitmap object
; $iX - The X coordinate of the pixel
; $iY - The Y coordinate of the pixel
; $iARGB - The new color of the pixel
; Return values .: Success - True
; Failure - False and either:
; |@error and @extended are set if DllCall failed
; |$GDIP_STATUS contains a non zero value specifying the error code
; Remarks .......: None
; Related .......: _GDIPlus_BitmapGetPixel
; Link ..........; @@MsdnLink@@ GdipBitmapSetPixel
; Example .......; Yes
; ===============================================================================================================================
Func _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, $iARGB)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "hwnd", $hBitmap, "int", $iX, "int", $iY, "uint", $iARGB)
If @error Then Return SetError(@error, @extended, False)
$GDIP_STATUS = $aResult[0]
Return $aResult[0] = 0
EndFunc ;==>_GDIPlus_BitmapSetPixel
Ließ dir mal diesen Thread durch.
Das hier ist dafür verantwortlich:
[autoit]For $i = 0 To 270 Step 90
$VectorX1 = Cos(($Degree1 - 90 + $i) * $Pi_Div_180) * $Width1 + $GUIWidth / 2
$VectorY1 = Sin(($Degree1 - 90 + $i) * $Pi_Div_180) * $Height1 + $GUIHeight / 2 + 125
$Points1[$j][0] = $VectorX1
$Points1[$j][1] = $VectorY1
$j += 1
Next
$j = 1
For $i = 0 To 270 Step 90
$VectorX2 = Cos(($Degree2 - 90 + $i) * $Pi_Div_180) * $Width2 + $GUIWidth / 2
$VectorY2 = Sin(($Degree2 - 90 + $i) * $Pi_Div_180) * $Height2 + $GUIHeight / 2
$Points2[$j][0] = $VectorX2
$Points2[$j][1] = $VectorY2
$j += 1
Next
Und so schwer ist das doch nicht. Im Prinzip musst du es nicht einmal verstehen
.
Einfaches Beispiel folgt ![]()
Ja aber die nicht winterbilder sind 37x38
Und Ubuntu sagte, dass die Plattformen versetzt wären weil die Winterbilder ein anderes Format haben ![]()
GUICtrlCreateMenu
[/autoit]
und
GUICtrlCreateMenuItem
[/autoit]Ach ja falls du es noch nicht wissen solltest:
Für die Schriftarten:
GUICtrlSetFont
[/autoit]War mein Post etwa zu lang? Naja egal dann eben als Dateianhang.
Ich hab die Matrixfunktion ein wenig verändert, ich glaube so ist es weniger PC belastend...
Die UDF mit den neuen Funktionen ist auch im Anhang.
Zu den Bildern: Bei mir hatten die das selbe Format wie die anderen nicht-winter Bilder.
Hast du sie mal im Script verwendet?
Ich habe sie jetzt auch mal im Script verwendet und sie sind wirklich ein bisschen klein vermutlich wegen der Mütze des Doodles...
Aber obwohl sie exakt das selbe Format haben wie die anderen und auch am unteren Bildrand anfangen scheinen die Winterplattformen immer noch vertikal versetzt zu sein. ![]()
Ließ doch einfach das Edit Control mit GUICtrlRead aus und speichere diese Daten in einer Textdatei ab.
Wenn du eine erzeugen möchtest, dann verwende einfach $File = FileOpen("Textdatei.txt", 1). Wenn FileOpen eine nicht existierende Datei öffnet wird sie einfach erzeugt.
Danach aber nicht das FileClose($File) vergessen. ![]()
Vielleicht lässt sich das ja mit dem Sleep Befehl machen. Oder du versuchst es über die Registry, ich bin mir allerdings nicht sicher wann diese Programme gestartet werden. ![]()
So besser?
Sogar im png Format was meiner Meinung nach eher geeignet ist.
Nichts für ungut, aber ich glaube in GDI+ könnte man das noch besser umsetzen
Vor allem weil es da eine Funktion gibt um die Farbe eines bestimmten Pixels in einer Bitmap auszulesen
Das ist einfach zuverlässiger als die PixelGetColor Funktion, zumal man dann auch ganz normal das Fenster schließen und verschieben könnte. ![]()
Ja
Ich hoffe das hier hilft dir weiter.
ZitatWieso?
Weil du $var als Array deklarierst. Du müsstest es dann z.B. so schreiben:
_INetMail("Mail@web.de","Dein Betreff",$var[0] & $var[1])
[/autoit]Ist gut geworden, nur beim Wintermodus erscheinen die Platten irgendwie tiefer als sie eigentlich sind ![]()
Zitatansonst nettes game nur ich muss immer kurz vor der scheibe klicken sonst verfehl ich
Das liegt vielleicht daran, dass GDI+ langsamer zeichnet als das Script die Koordinaten neu berechnet
Naja solange du überhaupt triffst ![]()
Ach ja hat vielleicht jemand eine Idee welche Musik ich als Hintergrundmusik verwenden könnte? Ich hab schon viel Lizenzfreies gefunden, aber noch nichts was zu meinem Spiel passt. ![]()
Version 1.1 mit kleinen Verbesserungen siehe 1.Post
ControlGetText dürfte weiterhelfen.
Ach ja zu deinem Problem mit dem herunterfallen gleich am Anfang:
Bau doch am Anfang eine Art Grundlinie aus solchen Pads ein, a la Icy Tower. ![]()
ShellExecute und dann als Dateierweiterung lnk angeben. ![]()
Hier mal die überarbeitete Version mit der Backflip sowohl im Winter- als auch im Normalmodus funktioniert, einziges Problem ist, dass ich den Mittelpunkt des Doodle Bildes nicht richtig bestimmen kann weil ich mich jetzt ca. 15min mit deinem Script beschäftigt gabe und noch nicht alle Variablen kenne.
Das kannst ja dann du übernehmen. ![]()
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#include <GDIPlus.au3>
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <timers.au3>
#include <sound.au3>
#include <inet.au3>
#include <array.au3>
$Width = 300
$Height = 460
$JumpSpeed = 0.15
$JumpHeight = 80 ;Pixel
$MoveSpeed = 0
$Zeitschrit = 0.2
Global Const $Bilder = @ScriptDir & "\Bilder\"
Global Const $Sound = @ScriptDir & "\Sounds\"
;==================== Hotkeyset, Gui, Eventmode
HotKeySet("{PAUSE}", "_pause")
$GUI1 = GUICreate("Doodle Jump - Beta", $Width, $Height)
GUISetState(@SW_SHOW)
Opt("guioneventmode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "ende")
AutoItSetOption("MouseCoordMode", 0)
;==================== Sound
$sPropeller = _SoundOpen($Sound & "propeller.wav")
$sFall = _SoundOpen($Sound & "falldown.wav")
$sJump = _SoundOpen($Sound & "Jump.wav")
$sRakete = _SoundOpen($Sound & "Jetpack.wav")
$sSprung = _SoundOpen($Sound & "Feder.wav")
$sSf = _SoundOpen($Sound & "springshoes.wav")
$sTrampolin = _SoundOpen($Sound & "trampoline.wav")
;=========================== Gdi+ Grafik vorbereiten
_GDIPlus_Startup()
$Graphic = _GDIPlus_GraphicsCreateFromHWND($GUI1)
$Bitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $Graphic)
$Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
;=========================== gleichbleibende Bilder
$Rakete = _GDIPlus_ImageLoadFromFile($Bilder & "Rakete.gif")
$Newhighscore = _GDIPlus_ImageLoadFromFile($Bilder & "Newhighscore.gif")
$Gameover = _GDIPlus_ImageLoadFromFile($Bilder & "Gameover.gif")
$Scorebackground = _GDIPlus_ImageLoadFromFile($Bilder & "scorebackground.gif")
$Hut = _GDIPlus_ImageLoadFromFile($Bilder & "Hut.gif")
$Schwarz = _GDIPlus_ImageLoadFromFile($Bilder & "Bildschwarz.gif")
$Pausebild = _GDIPlus_ImageLoadFromFile($Bilder & "Paused.gif")
$Optionscreen = _GDIPlus_ImageLoadFromFile($Bilder & "Optionen.gif")
$Federzu = _GDIPlus_ImageLoadFromFile($Bilder & "Feder zu.gif")
$Federoffen = _GDIPlus_ImageLoadFromFile($Bilder & "Feder offen.gif")
$Federz_Height = _GDIPlus_ImageGetHeight($Federzu)
$Federo_Height = _GDIPlus_ImageGetHeight($Federoffen)
$Doodle_sf_r = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Sf_r.gif")
$Doodle_sf_l = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Sf_l.gif")
$Doodle_sf_gesch_l = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Sf_gesch_l.gif")
$Doodle_sf_gesch_r = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Sf_gesch_r.gif")
$sf_schuhe = _GDIPlus_ImageLoadFromFile($Bilder & "Sf schuhe.gif")
$Doodle_sf_Height = _GDIPlus_ImageGetHeight($Doodle_sf_r)
$Doodle_sf_gesch_Height = _GDIPlus_ImageGetHeight($Doodle_sf_gesch_l)
$Trampolin = _GDIPlus_ImageLoadFromFile($Bilder & "Trampolin.gif")
$Trampolin1 = _GDIPlus_ImageLoadFromFile($Bilder & "Trampolin 1.gif")
;=========================== normale Bilder
$nBackground = _GDIPlus_ImageLoadFromFile($Bilder & "background.gif")
$nStart = _GDIPlus_ImageLoadFromFile($Bilder & "Start1.gif")
$nDoodleHutl = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Links k.gif")
$nDoodleHutr = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Rechts k.gif")
$nDoodleHutl1 = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Links l.gif")
$nDoodleHutr1 = _GDIPlus_ImageLoadFromFile($Bilder & "Doodle_Rechts l.gif")
$nPunkteleiste = _GDIPlus_ImageLoadFromFile($Bilder & "Punkteleiste.gif")
$nPlatform_gruen = _GDIPlus_ImageLoadFromFile($Bilder & "Platform grün.gif")
$nPlatform_hellblau = _GDIPlus_ImageLoadFromFile($Bilder & "Platform hellblau.gif")
$nDoodle_Rechts = _GDIPlus_BitmapCreateFromFile($Bilder & "Doodle_Rechts e.png")
$nDoodle_Links = _GDIPlus_BitmapCreateFromFile($Bilder & "Doodle_Links e.png")
$nDoodle_Height = _GDIPlus_ImageGetHeight($nDoodle_Rechts)
$nDoodle_Width = _GDIPlus_ImageGetWidth($nDoodle_Rechts)
$iDiag_Doodle = Sqrt(($nDoodle_Width) ^ 2 + ($nDoodle_Height) ^ 2)
$nPlat_Width = _GDIPlus_ImageGetWidth($nPlatform_gruen)
$nDoodleRakl = _GDIPlus_ImageLoadFromFile($Bilder & "Rakete l.gif")
$nDoodleRakr = _GDIPlus_ImageLoadFromFile($Bilder & "Rakete r.gif")
;=========================== Winter Bilder
$wBackground = _GDIPlus_ImageLoadFromFile($Bilder & "background winter.gif")
$wStart = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Start.gif")
$wDoodleHutl = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle ll.gif")
$wDoodleHutr = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle rl.gif")
$wDoodleHutl1 = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle lk.gif")
$wDoodleHutr1 = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle rk.gif")
$wPunkteleiste = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Punkteleiste.gif")
$wPlatform_gruen = _GDIPlus_ImageLoadFromFile($Bilder & "Winter gruen.gif")
$wPlatform_hellblau = _GDIPlus_ImageLoadFromFile($Bilder & "Winter gruen.gif")
$wDoodle_Rechts = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle re.gif")
$wDoodle_Links = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle l.gif")
$wDoodle_Height = _GDIPlus_ImageGetHeight($wDoodle_Rechts)
$wDoodle_Width = _GDIPlus_ImageGetWidth($wDoodle_Rechts)
$wPlat_Width = _GDIPlus_ImageGetWidth($wPlatform_gruen)
$wDoodleRakl = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle rakete l.gif")
$wDoodleRakr = _GDIPlus_ImageLoadFromFile($Bilder & "Winter Doodle rakete r.gif")
$wFederzu = _GDIPlus_ImageLoadFromFile($Bilder & "Feder zu.gif")
$wFederoffen = _GDIPlus_ImageLoadFromFile($Bilder & "Feder offen.gif")
;============================= für Optionstext
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Comic Sans MS")
$hFont = _GDIPlus_FontCreate($hFamily, 11, 1)
$tLayout1 = _GDIPlus_RectFCreate(44, 134, 0, 0)
$tLayout2 = _GDIPlus_RectFCreate(115, 134, 0, 0)
$tLayout3 = _GDIPlus_RectFCreate(49, 252, 0, 0)
$tLayout4 = _GDIPlus_RectFCreate(120, 252, 0, 0)
$aInfo1 = _GDIPlus_GraphicsMeasureString($Buffer, "mouse", $hFont, $tLayout1, $hFormat)
$aInfo2 = _GDIPlus_GraphicsMeasureString($Buffer, "arrow keys", $hFont, $tLayout2, $hFormat)
$aInfo3 = _GDIPlus_GraphicsMeasureString($Buffer, "on", $hFont, $tLayout3, $hFormat)
$aInfo4 = _GDIPlus_GraphicsMeasureString($Buffer, "off", $hFont, $tLayout4, $hFormat)
;===================== Var Deklarierung
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Global $ReadS[5], $federpos[20], $ReadN[5], $gruen_n[13][4], $optioncoloron = 0xff7CB639, $optioncoloroff = 0xffABA69F, $hutt = 3, $tnorm, $grav = 9.81, $untersprung = 0, $fSprung = 0, $Angle = 0, $sprung = 0, $sprungkraft = 50, $Sprungf = 0, $Sprungnu = 0
Global $Background, $Start, $DoodleHutl, $DoodleHutr, $DoodleHutl1, $DoodleHutr1, $Punkteleiste, $Platform_gruen, $Platform_hellblau, $AktuellerDoodle, _
$Doodle_Rechts, $Doodle_Links, $Doodle_Height, $Doodle_Width, $Plat_Width, $DoodleRakl, $DoodleRakr
Global $punktelimit = 1000, $abstand = -40, $paused = 0, $die = False, $i = 0, $t = 0, $x = $gruen_n[0][0], $y = 380 - $Doodle_Height, _
$onplatform = 0, $t1 = 0, $normpos, $huttimer, $ybodenalt, $hutbild = 0
Global $plat = 0, $raketeon = 0, $timerrakon = 0, $raketentimer = 0, $move = 0, $score = 0, $scoreplus = 0, $yboden = $gruen_n[0][1], $Platmovespeed = 0, $platten = 0, $huton = 0, $nAngle = 0, $timeron = 0, $dll = DllOpen("user32.dll"), $Sprungnu = 0
Global Const $Pi_Div_180 = 4 * ATan(1) / 180
Global $bewegrichtung[17] = [Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1)]
For $n = 0 To UBound($gruen_n) - 1
$gruen_n[$n][0] = Random(0, $Width - $Plat_Width, 1)
$gruen_n[$n][1] = 400 - ($n * 60)
$gruen_n[$n][2] = 0
$gruen_n[$n][3] = 0
Next
;==================== Inireads
$datapath = @ScriptDir & "\Scores.ini"
$wintermod = IniRead($datapath, "Optionen", "Wintermode", "0")
$movement = IniRead($datapath, "Optionen", "movement", "0")
$soundoff = IniRead($datapath, "Optionen", "soundoff", "0")
$ReadS[0] = IniRead($datapath, "Scores", "1", "")
$ReadS[1] = IniRead($datapath, "Scores", "2", "")
$ReadS[2] = IniRead($datapath, "Scores", "3", "")
$ReadS[3] = IniRead($datapath, "Scores", "4", "")
$ReadS[4] = IniRead($datapath, "Scores", "5", "")
$ReadN[0] = IniRead($datapath, "Names", "1", "")
$ReadN[1] = IniRead($datapath, "Names", "2", "")
$ReadN[2] = IniRead($datapath, "Names", "3", "")
$ReadN[3] = IniRead($datapath, "Names", "4", "")
$ReadN[4] = IniRead($datapath, "Names", "5", "")
;============================= für Optionstextfarbe
If $movement = 0 Then
$hBrush1 = _GDIPlus_BrushCreateSolid(0xff7CB639)
$hBrush2 = _GDIPlus_BrushCreateSolid(0xffABA69F)
Else
$hBrush2 = _GDIPlus_BrushCreateSolid(0xff7CB639)
$hBrush1 = _GDIPlus_BrushCreateSolid(0xffABA69F)
EndIf
If $soundoff = 0 Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xff7CB639)
$hBrush4 = _GDIPlus_BrushCreateSolid(0xffABA69F)
Else
$hBrush4 = _GDIPlus_BrushCreateSolid(0xff7CB639)
$hBrush3 = _GDIPlus_BrushCreateSolid(0xffABA69F)
EndIf
;============================= Winter on/off
If $wintermod = 1 Then
_winter()
$AktuellerDoodle = $wDoodle_Rechts
Else
_winteroff()
$AktuellerDoodle = $nDoodle_Rechts
EndIf
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI1)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphics)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_Start()
[/autoit] [autoit][/autoit] [autoit]While 1
If $paused = 1 Then
_GDIPlus_GraphicsDrawImageRectRectTrans($Buffer, $Schwarz, 0, 0, "", "", "", "", "", "", 2, 50)
_GDIPlus_GraphicsDrawImage($Buffer, $Pausebild, $Width / 2 - 64, $Height / 2 - 37.5)
Do
Sleep(50)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
Until $paused = 0
EndIf
If $y - 5 > $Height Then $die = True
If $die = False Then
If WinActive("[active]") = $GUI1 Then
Redraw()
EndIf
$soundplayed = 0
ElseIf $scoreplus > $ReadS[4] Then
Newscore()
ElseIf $scoreplus < $ReadS[4] Then
Dead()
EndIf
WEnd
Func Redraw()
If $movement = 0 Then
$aktualpos = MouseGetPos()
If $aktualpos[0] < $Width / 2 Then
$MoveSpeed = ($aktualpos[0] - $Width / 2) / 3
Select
Case $huton = 0 And $raketeon = 0 And $Sprungf = 0
$AktuellerDoodle = $Doodle_Links
Case $raketeon = 1
$AktuellerDoodle = $DoodleRakl
Case $huton = 1
$AktuellerDoodle = $DoodleHutl
Case $Sprungf = 1
$AktuellerDoodle = $Doodle_sf_l
EndSelect
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]EndIf
If $aktualpos[0] > $Width / 2 Then
$MoveSpeed = ($aktualpos[0] - $Width / 2) / 3
Select
Case $huton = 0 And $raketeon = 0 And $Sprungf = 0
$AktuellerDoodle = $Doodle_Rechts
Case $raketeon = 1
$AktuellerDoodle = $DoodleRakr
Case $huton = 1
$AktuellerDoodle = $DoodleHutr
Case $Sprungf = 1
$AktuellerDoodle = $Doodle_sf_r
EndSelect
EndIf
Else
If _IsPressed("25", $dll) Then
$MoveSpeed -= 2
Select
Case $huton = 0 And $raketeon = 0 And $Sprungf = 0
$AktuellerDoodle = $Doodle_Links
Case $raketeon = 1
$AktuellerDoodle = $DoodleRakl
Case $huton = 1
$AktuellerDoodle = $DoodleHutl
Case $Sprungf = 1
$AktuellerDoodle = $Doodle_sf_l
EndSelect
EndIf
If _IsPressed("27", $dll) Then
$MoveSpeed += 2
Select
Case $huton = 0 And $raketeon = 0 And $Sprungf = 0
$AktuellerDoodle = $Doodle_Rechts
Case $raketeon = 1
$AktuellerDoodle = $DoodleRakr
Case $huton = 1
$AktuellerDoodle = $DoodleHutr
Case $Sprungf = 1
$AktuellerDoodle = $Doodle_sf_r
EndSelect
EndIf
EndIf
Select
Case $x + $Doodle_Width < 0
$x = $Width
Case $x > $Width
$x = $Doodle_Width * - 1
Case $MoveSpeed > 30
$MoveSpeed = 30
Case $MoveSpeed < -30
$MoveSpeed = -30
EndSelect
$i += $JumpSpeed
$platnotactive = 0
$platactive = 0
$yalt = $y
$platold = $plat
If $huton = 0 And $raketeon = 0 Then
$t += $Zeitschrit
If $wintermod = 1 Then
If $yboden = $y + 30 Then
$y = $yboden - $Doodle_Height - Round(Abs($sprungkraft * $t - ($grav / 2) * $t ^ 2))
Else
$y = $yboden - $Doodle_Height - Round($sprungkraft * $t - ($grav / 2) * $t ^ 2)
EndIf
Else
If $yboden = $y + 30 Then
$y = $yboden - $Doodle_Height - 10 - Round(Abs($sprungkraft * $t - ($grav / 2) * $t ^ 2))
Else
$y = $yboden - $Doodle_Height - 10 - Round($sprungkraft * $t - ($grav / 2) * $t ^ 2)
EndIf
EndIf
$ybodenalt = $yboden
If $huton = 0 And $raketeon = 0 Then
For $n = 0 To UBound($gruen_n, 1) - 1 Step 1
If $untersprung = 1 Then
$Platmovespeed = 14
Else
Select
Case $y < 0
$Platmovespeed = 14
Case $y < 220 And $y > 180
$move = 1
$Platmovespeed = 1
Case $y < 180
$Platmovespeed = 4
Case $y > 180
$Platmovespeed = 0
Case $y >= 220
$move = 0
$Platmovespeed = 0
EndSelect
EndIf
If $gruen_n[$n][3] = 7 Then $gruen_n[$n][3] = 6
If $untersprung = 0 Then
Select
Case ($gruen_n[$n][0] - $Doodle_Width <= $x And $gruen_n[$n][0] + $Plat_Width >= $x) And ($y + $Doodle_Height <= $gruen_n[$n][1] And $y + $Doodle_Height + 15 >= $gruen_n[$n][1])
If $yalt < $y Then
$onplatform = 1
$plat = $n
$t = 0
$t = $Zeitschrit
$yboden = $gruen_n[$n][1]
$platten += 1
If $platold < $plat Or ($platold = 16 And $plat = 0) Then
$scoreplus += 100
EndIf
If $gruen_n[$n][3] = 1 Then
If $AktuellerDoodle = $Doodle_Links Then
$AktuellerDoodle = $DoodleHutl
Else
$AktuellerDoodle = $DoodleHutr
EndIf
$gruen_n[$n][3] = 0
$huton = 1
EndIf
If $gruen_n[$n][3] = 2 Then
If $AktuellerDoodle = $Doodle_Rechts Then
$AktuellerDoodle = $DoodleRakr
Else
$AktuellerDoodle = $DoodleRakl
EndIf
$gruen_n[$n][3] = 0
$raketeon = 1
EndIf
If $sprung = 1 Then
$sprung = 0
$sprungkraft /= 1.5
EndIf
If $sprung = 2 Then
$fSprung = 0
$sprung = 0
$sprungkraft /= 2
EndIf
If $gruen_n[$n][3] = 3 Then
If ($gruen_n[$n][0] + $federpos[$n] - $Doodle_Width <= $x And $gruen_n[$n][0] + $federpos[$n] + 17 >= $x) Then
If $soundoff = 0 Then _SoundPlay($sSprung)
$gruen_n[$n][3] = 4
$sprung = 1
$sprungkraft *= 1.5
EndIf
EndIf
If $gruen_n[$n][3] = 6 Then
If $soundoff = 0 Then _SoundPlay($sTrampolin)
$gruen_n[$n][3] = 7
$sprung = 2
$sprungkraft *= 2
EndIf
If $Sprungf = 0 Then
If $gruen_n[$n][3] = 5 Then
If $soundoff = 0 Then _SoundPlay($sSf)
If $AktuellerDoodle = $Doodle_Rechts Then
$AktuellerDoodle = $Doodle_sf_gesch_r
Else
$AktuellerDoodle = $Doodle_sf_gesch_l
EndIf
$gruen_n[$n][3] = 0
$sprungkraft = 70
$Sprungf = 1
EndIf
EndIf
If $Sprungf = 1 Then
If $soundoff = 0 Then _SoundPlay($sSf)
If $AktuellerDoodle = $Doodle_sf_r Then
$AktuellerDoodle = $Doodle_sf_gesch_r
Else
$AktuellerDoodle = $Doodle_sf_gesch_l
EndIf
$Sprungnu += 1
If $Sprungnu = 6 Then
$Sprungf = 0
$Sprungnu = 0
$sprungkraft = 50
If $AktuellerDoodle = $Doodle_sf_gesch_r Then
$AktuellerDoodle = $Doodle_Rechts
Else
$AktuellerDoodle = $Doodle_Links
EndIf
EndIf
EndIf
If $soundoff = 0 And $sprung = 0 Then _SoundPlay($sJump)
EndIf
EndSelect
EndIf
Next
EndIf
EndIf
;~ For $n = 0 to Ubound(
[/autoit] [autoit][/autoit] [autoit]$x += $MoveSpeed * $t / 10
If $raketeon = 0 And $huton = 0 Then
If $ybodenalt > $yboden Then $scoreplus += Abs(($yboden - $ybodenalt))
EndIf
;~
If $y + 5 > $Height Then
;~ MsgBox(0, "", $yboden)
$die = True
EndIf
If $huton = 1 Then
$plus = 15
ElseIf $raketeon = 1 Then
$plus = 30
Else
$plus = 10
EndIf
If $scoreplus > $score Then
$score += $plus
ElseIf (Not $scoreplus / 10 = Round($scoreplus / 10) * 10) Then
$score += $scoreplus - Round($scoreplus / 10) * 10
EndIf
;======================HUT
If $huton = 1 Then
If $timeron = 0 Then
If $soundoff = 0 Then _SoundPlay($sPropeller, 0)
$scoreplus += 1500
$huttimer = _Timer_Init()
$timeron = 1
$tnorm = $t
$t = $hutt
EndIf
$Platmovespeed = 6
$time = _Timer_Diff($huttimer)
If $hutbild = 0 Then
If $AktuellerDoodle = $DoodleHutl Then
$AktuellerDoodle = $DoodleHutl1
ElseIf $AktuellerDoodle = $DoodleHutr Then
$AktuellerDoodle = $DoodleHutr1
EndIf
$hutbild = 1
Else
If $AktuellerDoodle = $DoodleHutl1 Then
$AktuellerDoodle = $DoodleHutl
ElseIf $AktuellerDoodle = $DoodleHutr1 Then
$AktuellerDoodle = $DoodleHutr
EndIf
$hutbild = 0
EndIf
If $time >= 3000 Then
$t = $tnorm
$huton = 0
$timeron = 0
If $AktuellerDoodle = $DoodleHutr Then
$AktuellerDoodle = $Doodle_Rechts
Else
$AktuellerDoodle = $Doodle_Links
EndIf
EndIf
EndIf
;=========================Rakete
If $raketeon = 1 Then
If $timerrakon = 0 Then
If $soundoff = 0 Then _SoundPlay($sRakete, 0)
$scoreplus += 3000
$raketentimer = _Timer_Init()
$timerrakon = 1
$tnorm = $t
$t = $hutt
If $AktuellerDoodle = $Doodle_Rechts Then
$AktuellerDoodle = $DoodleRakr
Else
$AktuellerDoodle = $DoodleRakl
EndIf
EndIf
$Platmovespeed = 15
$time = _Timer_Diff($raketentimer)
If $time >= 3000 Then
$raketeon = 0
$timerrakon = 0
$t = $tnorm
If $AktuellerDoodle = $DoodleRakr Then
$AktuellerDoodle = $Doodle_Rechts
Else
$AktuellerDoodle = $Doodle_Links
EndIf
EndIf
EndIf
If $fSprung = 0 Then
If $sprung = 2 Then
If $Angle = 360 Then
$untersprung = 0
$fSprung = 1
$Angle = 0
Else
$untersprung = 1
$Angle += 15
EndIf
EndIf
EndIf
If $move = 1 Then
If $huton = 0 And $raketeon = 0 Then
$yboden += $Platmovespeed
EndIf
For $n = 0 To UBound($gruen_n) - 1
$gruen_n[$n][1] += $Platmovespeed
If $gruen_n[$n][2] = 1 Then
Select
Case $gruen_n[$n][0] <= 30
$bewegrichtung[$n] = 1
Case $gruen_n[$n][0] + $Plat_Width >= $Width - 30
$bewegrichtung[$n] = 0
EndSelect
If $bewegrichtung[$n] = 1 Then
$gruen_n[$n][0] += 3
Else
$gruen_n[$n][0] -= 3
EndIf
EndIf
If $gruen_n[$n][1] > $Height Then
reset($n)
EndIf
Next
[/autoit] [autoit][/autoit] [autoit]EndIf
[/autoit] [autoit][/autoit] [autoit];~ MsgBox(0, "", $MoveSpeed)
[/autoit] [autoit][/autoit] [autoit];~ _GDIPlus_GraphicsClear($Buffer, 0xFFFFFFFF)
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Background, 0, 0)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If $wintermod = 1 Then
For $n = 0 To UBound($gruen_n, 1) - 1
Switch $gruen_n[$n][3]
Case 1
_GDIPlus_GraphicsDrawImage($Buffer, $Hut, $gruen_n[$n][0], $gruen_n[$n][1] - 23 - 10)
Case 2
_GDIPlus_GraphicsDrawImage($Buffer, $Rakete, $gruen_n[$n][0], $gruen_n[$n][1] - 37 - 10)
Case 3
_GDIPlus_GraphicsDrawImage($Buffer, $Federzu, $gruen_n[$n][0] + $federpos[$n], $gruen_n[$n][1] - $Federz_Height - 10)
Case 4
_GDIPlus_GraphicsDrawImage($Buffer, $Federoffen, $gruen_n[$n][0] + $federpos[$n], $gruen_n[$n][1] - $Federo_Height - 10)
Case 5
_GDIPlus_GraphicsDrawImage($Buffer, $sf_schuhe, $gruen_n[$n][0], $gruen_n[$n][1] - 21 - 10)
Case 5
_GDIPlus_GraphicsDrawImage($Buffer, $Trampolin, $gruen_n[$n][0] + 15, $gruen_n[$n][1] - 21 - 10)
EndSwitch
Switch $gruen_n[$n][2]
Case 0
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_gruen, $gruen_n[$n][0], $gruen_n[$n][1] - 10)
Case 1
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_hellblau, $gruen_n[$n][0], $gruen_n[$n][1] - 10)
;~ Case 2
;~ _GDIPlus_GraphicsDrawImage ($Buffer, $Platform_weis, $gruen_n[$n][0], $gruen_n[$n][1])
;~ $weisx = $gruen_n[1][0]
;~ $weisy = $gruen_n[$n][1]
;~ _GDIPlus_GraphicsDrawImageRectRectTrans($Buffer, $Platform_weis, $weisx, $weisx, "", "", "", "", "" , "", 2, 50)
EndSwitch
Next
Else
For $n = 0 To UBound($gruen_n, 1) - 1
Switch $gruen_n[$n][3]
Case 1
_GDIPlus_GraphicsDrawImage($Buffer, $Hut, $gruen_n[$n][0], $gruen_n[$n][1] - 23)
Case 2
_GDIPlus_GraphicsDrawImage($Buffer, $Rakete, $gruen_n[$n][0], $gruen_n[$n][1] - 37)
Case 3
_GDIPlus_GraphicsDrawImage($Buffer, $Federzu, $gruen_n[$n][0] + $federpos[$n], $gruen_n[$n][1] - $Federz_Height)
Case 4
_GDIPlus_GraphicsDrawImage($Buffer, $Federoffen, $gruen_n[$n][0] + $federpos[$n], $gruen_n[$n][1] - $Federo_Height)
Case 5
_GDIPlus_GraphicsDrawImage($Buffer, $sf_schuhe, $gruen_n[$n][0], $gruen_n[$n][1] - 21)
Case 6
_GDIPlus_GraphicsDrawImage($Buffer, $Trampolin, $gruen_n[$n][0] + 15, $gruen_n[$n][1] - 14)
EndSwitch
Switch $gruen_n[$n][2]
Case 0
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_gruen, $gruen_n[$n][0], $gruen_n[$n][1])
Case 1
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_hellblau, $gruen_n[$n][0], $gruen_n[$n][1])
Case 2
;~ _GDIPlus_GraphicsDrawImage ($Buffer, $Platform_weis, $gruen_n[$n][0], $gruen_n[$n][1])
;~ $weisx = $gruen_n[1][0]
;~ $weisy = $gruen_n[$n][1]
;~ _GDIPlus_GraphicsDrawImageRectRectTrans($Buffer, $Platform_weis, $weisx, $weisx, "", "", "", "", "" , "", 2, 50)
EndSwitch
[/autoit] [autoit][/autoit] [autoit]Next
EndIf
If $sprung = 2 And $fSprung = 0 Then
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, $x + $Doodle_Width / 2, $y + $Doodle_Height / 2)
_GDIPlus_MatrixRotate($hMatrix, $Angle)
_GDIPlus_GraphicsSetTransform($Buffer, $hMatrix)
_GDIPlus_GraphicsDrawImage($Buffer, $AktuellerDoodle, 0, 0)
_GDIPlus_MatrixRotate($hMatrix, $Angle * -1)
_GDIPlus_MatrixTranslate($hMatrix, ($x + $Doodle_Width / 2) * -1, ($y + $Doodle_Height / 2) * -1)
_GDIPlus_GraphicsSetTransform($Buffer, $hMatrix)
_GDIPlus_MatrixDispose($hMatrix)
Else
_GDIPlus_GraphicsDrawImage($Buffer, $AktuellerDoodle, $x, $y)
EndIf
_GDIPlus_GraphicsDrawImageRectRectTrans($Buffer, $Punkteleiste, 0, 0, "", "", "", "", "", "", 2, 50)
_GDIPlus_GraphicsDrawString($Buffer, Round($score, 0), 5, 5, "Comic Sans MS", 15)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
[/autoit] [autoit][/autoit] [autoit]Sleep(20)
[/autoit] [autoit][/autoit] [autoit]EndFunc ;==>Redraw
;====================================================================================================================================================
;===========================================================================================================================================================
;===========================================================================================================================================================
;===========================================================================================================================================================
;===========================================================================================================================================================
;===========================================================================================================================================================
;===========================================================================================================================================================
Func reset($n)
$gruen_n[$n][0] = Random(0, $Width - $Plat_Width, 1)
If $n = 0 Then
$gruen_n[$n][1] = $gruen_n[UBound($gruen_n) - 1][1] + $abstand
Else
$gruen_n[$n][1] = $gruen_n[$n - 1][1] + $abstand
EndIf
If $scoreplus > 2000 Then
EndIf
If $scoreplus > 10000 Then
If $scoreplus > 30000 Then
$r = Random(0, 1, 1)
Else
$r = Random(0, 3, 1)
EndIf
Else
$r = Random(0, 10, 1)
EndIf
If $r = 1 Then
$gruen_n[$n][2] = 1
Else
$gruen_n[$n][2] = 0
EndIf
If $scoreplus >= $punktelimit Then
$abstand -= 3
$punktelimit = $punktelimit + ($punktelimit + 1000)
EndIf
If $gruen_n[$n][3] > 0 Then $gruen_n[$n][3] = 0
If (Not $Sprungf = 1) Then
$r = Random(0, 100, 1)
If $r = 3 Then $gruen_n[$n][3] = 1
If $r = 6 Then $gruen_n[$n][3] = 2
$r = Random(0, 50, 1)
If $r = 3 Then
$gruen_n[$n][3] = 3
If $n > 13 Then
$federpos[13] = Random(0, $Plat_Width - 17, 1)
Else
$federpos[$n] = Random(0, $Plat_Width - 17, 1)
EndIf
EndIf
;============== $gruen_n[$n][3] = 4 <== wird gebraucht Nicht benutzen!
If $r = 4 Then $gruen_n[$n][3] = 5
If $r = 5 Then $gruen_n[$n][3] = 6
EndIf
EndFunc ;==>reset
Func _GDIPlus_GraphicsDrawImageRectRectTrans($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth = "", $iSrcHeight = "", _
$iDstX = "", $iDstY = "", $iDstWidth = "", $iDstHeight = "", $iUnit = 2, $nTrans = 1)
Local $tColorMatrix, $x, $hImgAttrib, $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
If $iSrcWidth = 0 Or $iSrcWidth = "" Then $iSrcWidth = $iW
If $iSrcHeight = 0 Or $iSrcHeight = "" Then $iSrcHeight = $iH
If $iDstX = "" Then $iDstX = $iSrcX
If $iDstY = "" Then $iDstY = $iSrcY
If $iDstWidth = "" Then $iDstWidth = $iSrcWidth
If $iDstHeight = "" Then $iDstHeight = $iSrcHeight
If $iUnit = "" Then $iUnit = 2
;;create color matrix data
$tColorMatrix = DllStructCreate("float[5];float[5];float[5];float[5];float[5]")
;blending values:
$x = DllStructSetData($tColorMatrix, 1, 1, 1) * DllStructSetData($tColorMatrix, 2, 1, 2) * DllStructSetData($tColorMatrix, 3, 1, 3) * _
DllStructSetData($tColorMatrix, 4, $nTrans, 4) * DllStructSetData($tColorMatrix, 5, 1, 5)
;;create an image attributes object and update its color matrix
$hImgAttrib = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
$hImgAttrib = $hImgAttrib[1]
DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, _
"int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)
;;draw image into graphic object with alpha blend
DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGraphics, "hwnd", $hImage, "int", $iDstX, "int", _
$iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", $iSrcWidth, "int", _
$iSrcHeight, "int", $iUnit, "ptr", $hImgAttrib, "int", 0, "int", 0)
;;clean up
DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)
Return
EndFunc ;==>_GDIPlus_GraphicsDrawImageRectRectTrans
Func DrawInsert($hGraphic, $hImage2, $iX, $iY, $nAngle, $iWidth, $iHeight, $iARGB = 0xFF000000, $nWidth = 1)
Local $hMatrix, $hPen2
;Rotation Matrix
$hMatrix = _GDIPlus_MatrixCreate()
If $sprung = 2 Then
_GDIPlus_MatrixTranslate($hMatrix, $x + $Doodle_Width / 2, $y + $Doodle_Height / 2)
Else
_GDIPlus_MatrixTranslate($hMatrix, 0, 0)
EndIf
_GDIPlus_MatrixRotate($hMatrix, $nAngle, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage2, $iX, $iY)
[/autoit] [autoit][/autoit] [autoit];get pen + color
$hPen2 = _GDIPlus_PenCreate($iARGB, $nWidth)
; Draw a frame around the inserted image
_GDIPlus_GraphicsDrawRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hPen2)
; Clean up resources
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_PenDispose($hPen2)
Return 1
EndFunc ;==>DrawInsert
Func _Start()
;~ MsgBox(0,"","")
While 2
;~ $Label = GUICtrlCreateLabel("", 53, 149, 110, 41)
;~ GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
If WinActive("[active]") = $GUI1 Then
Select
Case _IsPressed("01")
$pos = MouseGetPos()
;MsgBox(0,$pos[0],$pos[1])
Select
Case $pos[0] > 155 And $pos[0] < 268 And $pos[1] > 318 And $pos[1] < 358
_optionen()
Case $pos[0] > 50 And $pos[0] < 153 And $pos[1] > 145 And $pos[1] < 182
[/autoit] [autoit][/autoit] [autoit]Global $federpos[20], $gruen_n[13][4], $optioncoloron = 0xff7CB639, $optioncoloroff = 0xffABA69F, $hutt = 3, $tnorm, $grav = 9.81, $sprung = 0, $sprungkraft = 50, $Sprungf = 0, $Sprungnu = 0
Global $punktelimit = 1000, $abstand = -40, $paused = 0, $die = False, $t = 0, $x = $gruen_n[0][0], $y = 380 - $Doodle_Height, $yboden = $gruen_n[0][1], _
$onplatform = 0, $t1 = 0, $normpos, $huttimer, $ybodenalt, $hutbild = 0, $wintermod = IniRead($datapath, "Optionen", "Wintermode", "0")
Global $plat = 0, $raketeon = 0, $timerrakon = 0, $raketentimer = 0, $move = 0, $score = 0, $scoreplus = 0, $yboden = $gruen_n[0][1], $Platmovespeed = 0, $platten = 0, $huton = 0, $timeron = 0, $dll = DllOpen("user32.dll")
Global $bewegrichtung[17] = [Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1)]
For $n = 0 To UBound($gruen_n) - 1
$gruen_n[$n][0] = Random(0, $Width - $Plat_Width, 1)
$gruen_n[$n][1] = 400 + ($n * $abstand)
$gruen_n[$n][2] = 0
$gruen_n[$n][3] = 0
Next
$x = $gruen_n[0][0]
$y = 380 - $Doodle_Height
$yboden = $gruen_n[0][1]
$die = False
$t = 0
$plat = 0
$MoveSpeed = 0
$move = 0
$Platmovespeed = 0
$platten = 0
$score = 0
$scoreplus = 0
ExitLoop
Case $pos[0] > 79 And $pos[0] < 185 And $pos[1] > 202 And $pos[1] < 240
_Showscore()
ExitLoop
Case $pos[0] > 188 And $pos[0] < 216 And $pos[1] > 446 And $pos[1] < 467
_winteroff()
Case $pos[0] > 245 And $pos[0] < 272 And $pos[1] > 416 And $pos[1] < 436
_winter()
EndSelect
EndSelect
EndIf
$y1 = 400 - $Doodle_Height - Round(Abs(Sin($i)) * $JumpHeight)
$x1 = 60
$i += $JumpSpeed
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Start, 0, 0)
_GDIPlus_GraphicsDrawImage($Buffer, $Doodle_Rechts, $x1, $y1)
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_gruen, 50, 400)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
Sleep(20)
WEnd
EndFunc ;==>_Start
Func _optionen()
If FileExists($datapath) Then
EndIf
;~ MsgBox(0, "", $ReadS[0])
While 3
$y = 400 - $Doodle_Height - 10 - Round(Abs(Sin($i)) * $JumpHeight)
$x = 60
$i += $JumpSpeed
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Optionscreen, 0, 0)
_GDIPlus_GraphicsDrawStringEx($Buffer, "mouse", $hFont, $aInfo1[0], $hFormat, $hBrush1)
_GDIPlus_GraphicsDrawStringEx($Buffer, "arrow keys", $hFont, $aInfo2[0], $hFormat, $hBrush2)
_GDIPlus_GraphicsDrawStringEx($Buffer, "on", $hFont, $aInfo3[0], $hFormat, $hBrush3)
_GDIPlus_GraphicsDrawStringEx($Buffer, "off", $hFont, $aInfo4[0], $hFormat, $hBrush4)
_GDIPlus_GraphicsDrawImage($Buffer, $Doodle_Rechts, $x, $y)
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_gruen, 50, 400)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
Sleep(20)
If WinActive("[active]") = $GUI1 Then
$pos = MouseGetPos()
Select
Case _IsPressed("01", $dll)
If $pos[0] > 184 And $pos[0] < 293 And $pos[1] > 389 And $pos[1] < 430 Then
_Start()
IniWrite($datapath, "Optionen", "movement", $movement)
IniWrite($datapath, "Optionen", "soundoff", $soundoff)
ExitLoop
EndIf
If $pos[0] > 47 And $pos[0] < 92 And $pos[1] > 165 And $pos[1] < 175 Then
_GDIPlus_BrushSetSolidColor($hBrush1, $optioncoloron)
_GDIPlus_BrushSetSolidColor($hBrush2, $optioncoloroff)
$movement = 0
EndIf
If $pos[0] > 118 And $pos[0] < 198 And $pos[1] > 165 And $pos[1] < 175 Then
_GDIPlus_BrushSetSolidColor($hBrush1, $optioncoloroff)
_GDIPlus_BrushSetSolidColor($hBrush2, $optioncoloron)
$movement = 1
EndIf
If $pos[0] > 53 And $pos[0] < 71 And $pos[1] > 284 And $pos[1] < 293 Then
_GDIPlus_BrushSetSolidColor($hBrush3, $optioncoloron)
_GDIPlus_BrushSetSolidColor($hBrush4, $optioncoloroff)
$soundoff = 0
EndIf
If $pos[0] > 125 And $pos[0] < 149 And $pos[1] > 279 And $pos[1] < 293 Then
_GDIPlus_BrushSetSolidColor($hBrush3, $optioncoloroff)
_GDIPlus_BrushSetSolidColor($hBrush4, $optioncoloron)
$soundoff = 1
EndIf
EndSelect
EndIf
WEnd
EndFunc ;==>_optionen
Func _Showscore()
;~ MsgBox(0, "", "")
If FileExists($datapath) Then
$ReadS[0] = IniRead($datapath, "Scores", "1", "")
$ReadS[1] = IniRead($datapath, "Scores", "2", "")
$ReadS[2] = IniRead($datapath, "Scores", "3", "")
$ReadS[3] = IniRead($datapath, "Scores", "4", "")
$ReadS[4] = IniRead($datapath, "Scores", "5", "")
$ReadN[0] = IniRead($datapath, "Names", "1", "")
$ReadN[1] = IniRead($datapath, "Names", "2", "")
$ReadN[2] = IniRead($datapath, "Names", "3", "")
$ReadN[3] = IniRead($datapath, "Names", "4", "")
$ReadN[4] = IniRead($datapath, "Names", "5", "")
EndIf
;~ MsgBox(0, "", $ReadS[0])
While 3
$y = 400 - $Doodle_Height - 10 - Round(Abs(Sin($i)) * $JumpHeight)
$x = 60
$i += $JumpSpeed
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Scorebackground, 0, 0)
For $n = 0 To 4
If $ReadS[$n] <> "" Then
_GDIPlus_GraphicsDrawString($Buffer, $ReadS[$n], $Width - 100, 211 + ($n - 1) * 23, "Comic Sans MS", 12)
_GDIPlus_GraphicsDrawString($Buffer, $ReadN[$n], $Width - 240, 211 + ($n - 1) * 23, "Comic Sans MS", 12)
EndIf
Next
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImage($Buffer, $Doodle_Rechts, $x, $y)
_GDIPlus_GraphicsDrawImage($Buffer, $Platform_gruen, 50, 400)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
Sleep(20)
If WinActive("[active]") = $GUI1 Then
$pos = MouseGetPos()
Select
Case _IsPressed("01", $dll)
If $pos[0] > 163 And $pos[0] < 269 And $pos[1] > 403 And $pos[1] < 444 Then
_Start()
ExitLoop
EndIf
EndSelect
EndIf
WEnd
EndFunc ;==>_Showscore
Func ende()
_GDIPlus_GraphicsDispose($Graphic)
_GDIPlus_ImageDispose($Buffer)
_WinAPI_DeleteObject($Bitmap)
_GDIPlus_Shutdown()
IniWrite($datapath, "Optionen", "Wintermode", $wintermod)
Exit
EndFunc ;==>ende
Func Newscore()
If $soundplayed = 0 Then
If $soundoff = 0 Then _SoundPlay($sFall)
$soundplayed = 1
EndIf
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Newhighscore, 0, 0)
_GDIPlus_GraphicsDrawString($Buffer, "Dein Score: " & $scoreplus, 24, 205, "Comic Sans MS", 12)
_GDIPlus_GraphicsDrawString($Buffer, "Name: ", 24, 225, "Comic Sans MS", 12)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
$ReadName = IniRead($datapath, "Names", "Eingetragenername", "")
$Input = GUICtrlCreateInput($ReadName, 79, 227)
GUICtrlSetLimit($Input, 9)
While 4
If WinActive("[active]") = $GUI1 Then
$pos = MouseGetPos()
Select
Case _IsPressed("01", $dll)
If $pos[0] > 98 And $pos[0] < 207 And $pos[1] > 284 And $pos[1] < 324 Then
$Name = GUICtrlRead($Input)
If $Name = "" Then $Name = "Spieler"
;~ If $serveroff = 0 Then
;~ _sendtoserver($Name, $scoreplus)
;~ Else
;~ _isserveron()
;~ EndIf
_iniwrite($Name)
[/autoit] [autoit][/autoit] [autoit]Global $federpos[20], $gruen_n[13][4], $optioncoloron = 0xff7CB639, $optioncoloroff = 0xffABA69F, $hutt = 3, $tnorm, $grav = 9.81, $sprung = 0, $sprungkraft = 50, $Sprungf = 0, $Sprungnu = 0
Global $punktelimit = 1000, $abstand = -40, $paused = 0, $die = False, $t = 0, $x = $gruen_n[0][0], $y = 380 - $Doodle_Height, $yboden = $gruen_n[0][1], _
$onplatform = 0, $t1 = 0, $normpos, $huttimer, $ybodenalt, $hutbild = 0, $wintermod = IniRead($datapath, "Optionen", "Wintermode", "0")
Global $plat = 0, $raketeon = 0, $timerrakon = 0, $raketentimer = 0, $move = 0, $score = 0, $scoreplus = 0, $yboden = $gruen_n[0][1], $Platmovespeed = 0, $platten = 0, $huton = 0, $timeron = 0, $dll = DllOpen("user32.dll")
Global $bewegrichtung[17] = [Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1)]
For $n = 0 To UBound($gruen_n) - 1
$gruen_n[$n][0] = Random(0, $Width - $Plat_Width, 1)
$gruen_n[$n][1] = 400 + ($n * $abstand)
$gruen_n[$n][2] = 0
$gruen_n[$n][3] = 0
Next
$x = $gruen_n[0][0]
$y = 380 - $Doodle_Height
$yboden = $gruen_n[0][1]
$die = False
$t = 0
$plat = 0
$MoveSpeed = 0
$move = 0
$Platmovespeed = 0
$platten = 0
$score = 0
$scoreplus = 0
GUICtrlDelete($Input)
ExitLoop
EndIf
If $pos[0] > 151 And $pos[0] < 261 And $pos[1] > 346 And $pos[1] < 381 Then
$Name = GUICtrlRead($Input)
If $Name = "" Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Or $Name = " " Then
$Name = "Spieler"
EndIf
;~ If $serveroff = 0 Then
;~ _sendtoserver($Name, $scoreplus)
;~ Else
;~ _isserveron()
;~ EndIf
_iniwrite($Name)
GUICtrlDelete($Input)
_Start()
ExitLoop
EndIf
EndSelect
EndIf
WEnd
EndFunc ;==>Newscore
Func _iniwrite($Name)
If $scoreplus > $ReadS[4] Then
If $scoreplus > $ReadS[3] Then
If $scoreplus > $ReadS[2] Then
If $scoreplus > $ReadS[1] Then
If $scoreplus > $ReadS[0] Then
IniWrite($datapath, "Scores", "1", $scoreplus)
IniWrite($datapath, "Scores", "2", $ReadS[0])
IniWrite($datapath, "Scores", "3", $ReadS[1])
IniWrite($datapath, "Scores", "4", $ReadS[2])
IniWrite($datapath, "Scores", "5", $ReadS[3])
IniWrite($datapath, "Names", "1", $Name)
IniWrite($datapath, "Names", "2", $ReadN[0])
IniWrite($datapath, "Names", "3", $ReadN[1])
IniWrite($datapath, "Names", "4", $ReadN[2])
IniWrite($datapath, "Names", "5", $ReadN[3])
Else
IniWrite($datapath, "Scores", "2", $scoreplus)
IniWrite($datapath, "Scores", "3", $ReadS[1])
IniWrite($datapath, "Scores", "4", $ReadS[2])
IniWrite($datapath, "Scores", "5", $ReadS[3])
IniWrite($datapath, "Names", "2", $Name)
IniWrite($datapath, "Names", "3", $ReadN[1])
IniWrite($datapath, "Names", "4", $ReadN[2])
IniWrite($datapath, "Names", "5", $ReadN[3])
EndIf
Else
IniWrite($datapath, "Scores", "3", $scoreplus)
IniWrite($datapath, "Scores", "4", $ReadS[2])
IniWrite($datapath, "Scores", "5", $ReadS[3])
IniWrite($datapath, "Names", "3", $Name)
IniWrite($datapath, "Names", "4", $ReadN[2])
IniWrite($datapath, "Names", "5", $ReadN[3])
EndIf
Else
IniWrite($datapath, "Scores", "4", $scoreplus)
IniWrite($datapath, "Scores", "5", $ReadS[3])
IniWrite($datapath, "Names", "4", $Name)
IniWrite($datapath, "Names", "5", $ReadN[3])
EndIf
Else
IniWrite($datapath, "Scores", "5", $scoreplus)
IniWrite($datapath, "Names", "5", $Name)
EndIf
EndIf
IniWrite($datapath, "Names", "Eingetragenername", $Name)
EndFunc ;==>_iniwrite
Func Dead()
If $soundplayed = 0 Then
If $soundoff = 0 Then _SoundPlay($sFall)
$soundplayed = 1
EndIf
_WinAPI_RedrawWindow($GUI1, "", "", $RDW_UPDATENOW + $RDW_FRAME)
_GDIPlus_GraphicsDrawImage($Buffer, $Gameover, 0, 0)
_GDIPlus_GraphicsDrawString($Buffer, "Dein Score: " & $scoreplus, 24, 185, "Comic Sans MS", 12)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
If WinActive("[active]") = $GUI1 Then
$pos = MouseGetPos()
Select
Case _IsPressed("01", $dll)
If $pos[0] > 93 And $pos[0] < 197 And $pos[1] > 253 And $pos[1] < 290 Then
;~ If $serveroff = 0 Then
;~ _sendtoserver(_GetIP(), $scoreplus)
;~ Else
;~ _isserveron()
;~ EndIf
Global $federpos[20], $gruen_n[13][4], $optioncoloron = 0xff7CB639, $optioncoloroff = 0xffABA69F, $hutt = 3, $tnorm, $grav = 9.81, $sprung = 0, $sprungkraft = 50, $Sprungf = 0, $Sprungnu = 0
Global $punktelimit = 1000, $abstand = -40, $paused = 0, $die = False, $t = 0, $x = $gruen_n[0][0], $y = 380 - $Doodle_Height, $yboden = $gruen_n[0][1], _
$onplatform = 0, $t1 = 0, $normpos, $huttimer, $ybodenalt, $hutbild = 0, $wintermod = IniRead($datapath, "Optionen", "Wintermode", "0")
Global $plat = 0, $raketeon = 0, $timerrakon = 0, $raketentimer = 0, $move = 0, $score = 0, $scoreplus = 0, $yboden = $gruen_n[0][1], $Platmovespeed = 0, $platten = 0, $huton = 0, $timeron = 0, $dll = DllOpen("user32.dll")
Global $bewegrichtung[17] = [Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1), _
Random(0, 1, 1), Random(0, 1, 1), Random(0, 1, 1)]
For $n = 0 To UBound($gruen_n) - 1
$gruen_n[$n][0] = Random(0, $Width - $Plat_Width, 1)
$gruen_n[$n][1] = 400 + ($n * $abstand)
$gruen_n[$n][2] = 0
$gruen_n[$n][3] = 0
Next
$x = $gruen_n[0][0]
$y = 380 - $Doodle_Height
$yboden = $gruen_n[0][1]
$die = False
$t = 0
$plat = 0
$MoveSpeed = 0
$move = 0
$Platmovespeed = 0
$platten = 0
$score = 0
$scoreplus = 0
EndIf
[/autoit] [autoit][/autoit] [autoit]If $pos[0] > 154 And $pos[0] < 260 And $pos[1] > 316 And $pos[1] < 352 Then
;~ If $serveroff = 0 Then
;~ _sendtoserver(_GetIP(), $scoreplus)
;~ Else
;~ _isserveron()
;~ EndIf
_Start()
[/autoit] [autoit][/autoit] [autoit]EndIf
EndSelect
EndIf
EndFunc ;==>Dead
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _winter()
$Background = $wBackground
$Start = $wStart
$DoodleHutl = $wDoodleHutl
$DoodleHutr = $wDoodleHutr
$DoodleHutl1 = $wDoodleHutl1
$DoodleHutr1 = $wDoodleHutr1
$Punkteleiste = $wPunkteleiste
$Platform_gruen = $wPlatform_gruen
$Platform_hellblau = $wPlatform_hellblau
$Doodle_Rechts = $wDoodle_Rechts
$Doodle_Links = $wDoodle_Links
$Doodle_Height = $wDoodle_Height
$Doodle_Width = $wDoodle_Width
$Plat_Width = $wPlat_Width
$DoodleRakl = $wDoodleRakl
$DoodleRakr = $wDoodleRakr
If $AktuellerDoodle = $Doodle_Links Then
$AktuellerDoodle = $Doodle_Links
Else
$AktuellerDoodle = $Doodle_Rechts
EndIf
$wintermod = 1
EndFunc ;==>_winter
Func _winteroff()
$Background = $nBackground
$Start = $nStart
$DoodleHutl = $nDoodleHutl
$DoodleHutr = $nDoodleHutr
$DoodleHutl1 = $nDoodleHutl1
$DoodleHutr1 = $nDoodleHutr1
$Punkteleiste = $nPunkteleiste
$Platform_gruen = $nPlatform_gruen
$Platform_hellblau = $nPlatform_hellblau
$Doodle_Rechts = $nDoodle_Rechts
$Doodle_Links = $nDoodle_Links
$Doodle_Height = $nDoodle_Height
$Doodle_Width = $nDoodle_Width
$Plat_Width = $nPlat_Width
$DoodleRakl = $nDoodleRakl
$DoodleRakr = $nDoodleRakr
If $AktuellerDoodle = $Doodle_Links Then
$AktuellerDoodle = $Doodle_Links
Else
$AktuellerDoodle = $Doodle_Rechts
EndIf
$wintermod = 0
EndFunc ;==>_winteroff
Func _pause()
If $paused = 0 Then
$paused = 1
Else
$paused = 0
EndIf
EndFunc ;==>_pause
;~ Func _sendtoserver($Name, $Score)
;~ _isserveron()
;~ If $serveroff = 0 Then
;~ $hCon = TCPConnect($IP,$PORT)
;~ TCPSend($hCon,$Name&"|"&$Score)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];~ EndIf
[/autoit] [autoit][/autoit] [autoit];~ EndFunc
[/autoit] [autoit][/autoit] [autoit];~ Func _isserveron()
;~ Ping($IP, 100)
;~ If @error Then $serveroff = 1
;~ If not @error Then $serveroff = 0
;~ EndFunc
Der überarbeitete Ausschnitt mit der Rotationsmatrix:
If $sprung = 2 And $fSprung = 0 Then
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, $x + $Doodle_Width / 2, $y + $Doodle_Height / 2)
_GDIPlus_MatrixRotate($hMatrix, $Angle)
_GDIPlus_GraphicsSetTransform($Buffer, $hMatrix)
_GDIPlus_GraphicsDrawImage($Buffer, $AktuellerDoodle, 0, 0)
_GDIPlus_MatrixRotate($hMatrix, $Angle * -1)
_GDIPlus_MatrixTranslate($hMatrix, ($x + $Doodle_Width / 2) * -1, ($y + $Doodle_Height / 2) * -1)
_GDIPlus_GraphicsSetTransform($Buffer, $hMatrix)
_GDIPlus_MatrixDispose($hMatrix)
Else
_GDIPlus_GraphicsDrawImage($Buffer, $AktuellerDoodle, $x, $y)
EndIf
_GDIPlus_GraphicsDrawImageRectRectTrans($Buffer, $Punkteleiste, 0, 0, "", "", "", "", "", "", 2, 50)
_GDIPlus_GraphicsDrawString($Buffer, Round($score, 0), 5, 5, "Comic Sans MS", 15)
_GDIPlus_GraphicsDrawImageRect($Graphic, $Bitmap, 0, 0, $Width, $Height)
[/autoit]
Im Prinzip wird der gesamte Buffer einmal um 15 Grad gedreht, der Doodle hineingezeichnet und dann der Buffer wieder zurück gedreht. Beim 2ten Durchlauf dann um 30 Grad etc.
Damit der Buffer um den Doodle herumgedreht werden kann bräuchte ich allerdings seinen (Der Doodle) Mittelpunkt.