Hallo Leute,
es geht darum ich möchte ein spiel konstruieren und dabei gibt es ein Problem:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{f}", "_Fire")
HotKeySet("{Space}", "_Reload")
Global $ishot = 10
Global $icon[11]
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Schuss Funktion ", 498, 242, 269, 188)
$Icon[10] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 168, 200, 32, 32)
$Icon[9] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 200, 200, 32, 32)
$Icon[8] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 232, 200, 32, 32)
$Icon[7] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 264, 200, 32, 32)
$Icon[6] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 296, 200, 32, 32)
$Icon[5] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 328, 200, 32, 32)
$Icon[4] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 360, 200, 32, 32)
$Icon[3] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 392, 200, 32, 32)
$Icon[2] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 424, 200, 32, 32)
$Icon[1] = GUICtrlCreateIcon("E:\Icon\lock.ico", -1, 456, 200, 32, 32)
$Label1 = GUICtrlCreateLabel("10", 136, 40, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _Fire()
GUICtrlDelete($icon[$ishot])
$ishot = $ishot -1
GUICtrlSetData($label1, $ishot)
If $ishot < 1 Then
MsgBox(0, "Moorhuhn", "Sie haben keine muntion mehr, laden sie nach")
EndIf
EndFunc
Func _Reload()
$iFiredshot = $ishot
$iShot = 10
GUICtrlSetData($label1, $ishot)
EndFunc
das is bis jetzt nur die Schuss FUnktion aber schon da gibt es ein Problem.. Ich kriege es einfach nich hin das wenn man reloadet alle die Icons die fehlen wieder herstellt ich hatte mir gedacht das diese Problem vlt.. mit For und next zu lösen ist konnte es aber nicht umsetzen. Manche würden sich vlt denken erstellt doch einfach jedes mal 10 neue Icons.. wer das meint sollte das mal testen...Wer sich jetzt nichts unter dem Schusssystem vor stehlen kann ..Es ist sowas wie z.B bei Moorhuhn
Mit freundlichen Grüßen CF*Gaming