Hi@all,
ich hab ein Problem, hört sich doof an oder?^^, ich bin grad dabei ein Spiel zu proggen, naja was heist spiel egal.
undzwar also als erstes kann man mit so nem zelda typ (auch link genannt^^) auf ner wiese laufen
da liegt mein erstes problem das mit der wiese und dem rumlaufen hab ich gecheckt aber wie krieg ich s hin wenn ich mit dem männchen iwo rauf (bestimmtes feld) komme das sich dann das kampf fenster öffnet?
und dann wenn das kampf fenster offen ist hat man 3 angriffe und 1 heiler da liegt das zweite problem wie krieg ichs hin das die Lebenspunkte variable "neu berechnet" wird also wenn jetzt die pfeil nachoben taste gedrückt wird ist zb ein angriff der 5 zieht das dann die LP variable "neu berechnet" wird also 100-5 = 95 und das dann angezeigt wird und das wenn jemand bei 0 ist das dann gesagt wird gewonnen/verloren
hier die unvollständigen skripte:
wiese:
Spoiler anzeigen
#include <GuiConstants.au3>
#include <GdiPlus.au3>;das include
#include <Misc.au3>
OnAutoItExitRegister("_end") ; die Funktion _end am Ende des Scriptes ausführen
[/autoit] [autoit][/autoit] [autoit]$x = 0;x und y deklarieren
$y = 0
$Gui = GUICreate("Zelpa", 579, 563, 100, 100)
GUISetState(@SW_SHOW)
_GDIPlus_Startup() ;Gdi starten
[/autoit] [autoit][/autoit] [autoit]$figur = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\figur.gif")
$bk = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\bg.jpg")
$height = _GDIPlus_ImageGetHeight($figur)
$width = _GDIPlus_ImageGetWidth($figur)
$verhaelnis = $height / $width
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(579, 563, $graphic);----------------- geändert ----------------------
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap);----------------- geändert ----------------------
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
Select
Case _IsPressed(25)
$x -= 3
Case _IsPressed(26)
$y -= 3
Case _IsPressed(27)
$x += 3
Case _IsPressed(28)
$y += 3
EndSelect
_GDIPlus_GraphicsDrawImageRect($buffer, $bk, 0, 0, 579, 563);----------------- geändert ----------------------
_GDIPlus_GraphicsDrawImageRect($buffer, $figur, $x, $y, 50, 50 * $verhaelnis);----------------- geändert ----------------------
_GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0);----------------- geändert ----------------------
Sleep(3)
WEnd
[/autoit] [autoit][/autoit] [autoit]Func _end();die Exit funktion
_GDIPlus_GraphicsDispose($graphic);Grafik Objekt freigeben
_GDIPlus_GraphicsDispose($buffer);----------------- geändert ----------------------
_GDIPlus_BitmapDispose($bitmap);----------------- geändert ----------------------
_GDIPlus_ImageDispose($figur);Bild Objekt 1 freigeben
_GDIPlus_ImageDispose($bk);Bild Objekt 2 freigeben
_GDIPlus_Shutdown();Ressourcen freigeben
EndFunc ;==>_end
kampf:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GdiPlus.au3>
$x = 100
$y = 100
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Kampf", 614, 449, 192, 150)
$Label1 = GUICtrlCreateLabel($x, 32, 16, 58, 29)
GUICtrlSetFont(-1, 16, 400, 0, "Arial Narrow")
$Label2 = GUICtrlCreateLabel($y, 488, 264, 58, 29)
GUICtrlSetFont(-1, 16, 400, 0, "Arial Narrow")
$Pic1 = GUICtrlCreatePic("C:\Users\Bormeister\programmierne\au3\game\images.jpg", 48, 208, 148, 212, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("C:\Users\Bormeister\programmierne\au3\game\mo.jpg", 424, 10, 164, 196, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label3 = GUICtrlCreateLabel("Pfeil nach oben: Schlag 15-mal verfügbar 4 Schaden", 280, 320, 278, 17)
$Label4 = GUICtrlCreateLabel("Pfeil nach links: Tritt 10-mal verfügbar 5 Schaden", 280, 351, 281, 17)
$Label5 = GUICtrlCreateLabel("Pfeil nach rechts: Heilen 2-mal verfügbar 5 Plus", 280, 367, 257, 17)
$Label6 = GUICtrlCreateLabel("Pfeil nach unten: Schwert 5-mal verfügbar 10 Schaden", 280, 335, 284, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
Select
Case _IsPressed(25) ;links
$y -= 5
Case _IsPressed(26) ;oben
$y -= 4
Case _IsPressed(27) ;rechts
$x += 5
Case _IsPressed(28) ;unten
$y -= 10
EndSelect
WEnd
MFG tomtomone96