[Blockierte Grafik: http://www7.pic-upload.de/14.08.11/u8gac8xekks.jpg]
Downloads
Beschreibung
Ich habe versucht so gu wie möglich Bomberman zu machen
Ich glaube jeder kennt das spiel sonst guckt wegen der bechreibung hier Wikipedia
Bomberman
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Misc.au3>
Global $Width = 720
Global $Height = 630
Global $String = 0
Dim $Path[12]
Dim $Object[500][3]
Dim $Red[9]
Dim $Blue[9]
Dim $RedBomb[12][3]
Dim $BlueBomb[12][3]
Dim $Value[12][3]
Dim $Button[10]
Dim $Options[100]
$Path[0] = @ScriptDir & "/Sounds/Sound.mp3"
$Path[1] = @ScriptDir & "/Sounds/Bomb.wav"
$Path[2] = IniRead(@ScriptDir & "/Options.ini", "General", "Style", "")
$Path[3] = IniRead(@ScriptDir & "/Options.ini", "General", "Map", "")
$Path[4] = @ScriptDir & "/Graphics/Right.gif"
$Path[5] = @ScriptDir & "/Graphics/Left.gif"
$Path[6] = @ScriptDir & "/Graphics/Above.gif"
$Path[7] = @ScriptDir & "/Graphics/Below.gif"
$Path[8] = @ScriptDir & "/Options.ini"
$Path[9] = @ScriptDir & "/Editor.exe"
$Path[10] = @ScriptDir & "/Editor.au3"
$Path[11] = _Style($Path[2])
Global $Wall = $Path[11] & "Wall.jpg"
$Value[2][0] = -30
$Value[3][0] = -60
$Value[4][0] = +30
$Value[5][0] = +60
$Value[6][0] = 0
$Value[7][0] = 0
$Value[8][0] = 0
$Value[9][0] = 0
$Value[10][0] = 0
$Value[2][1] = 0
$Value[3][1] = 0
$Value[4][1] = 0
$Value[5][1] = 0
$Value[6][1] = -30
$Value[7][1] = -60
$Value[8][1] = +30
$Value[9][1] = +60
$Value[10][1] = 0
$Value[2][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[3][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[4][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[5][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[6][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[7][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[8][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[9][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[10][2] = $Path[11] & "ExplosionMiddle.jpg"
SoundPlay($Path[0])
GUICreate("Bomberman", $Width, $Height)
$Button[9] = GUICtrlCreateLabel("U", $Width - 60, 30, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($Button[9], 0x000000)
GUICtrlSetColor($Button[9], 0xFFFFFF)
GUICtrlSetFont($Button[9], 18, 800, 0, "Webdings")
GUICtrlCreateGraphic(0, 0, $Width, 90)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlCreateGraphic(3, 3, $Width - 6, 84)
GUICtrlSetBkColor(-1, 0x2DAFCB)
$Button[0] = GUICtrlCreateButton("START", 246, 230, 235, 57)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Button[1] = GUICtrlCreateButton("OPTIONS", 246, 294, 235, 57)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Button[2] = GUICtrlCreateButton("EDITOR", 246, 358, 233, 57)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Button[3] = GUICtrlCreateButton("EXIT", 246, 422, 233, 57)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Button[4] = GUICtrlCreateGraphic(223, 202, 282, 303)
GUICtrlSetBkColor(-1, 0x9D9D9D)
$Button[5] = GUICtrlCreatePic($Path[4], 0, 202, 230, 428, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Button[6] = GUICtrlCreatePic($Path[5], 505, 202, 215, 428, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Button[7] = GUICtrlCreatePic($Path[6], 0, 90, 720, 112, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Button[8] = GUICtrlCreatePic($Path[7], 223, 505, 282, 125, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $Button[2]
If FileExists($Path[9]) Then
ShellExecute($Path[9])
Else
ShellExecute($Path[10])
EndIf
Case $GUI_EVENT_CLOSE
$iMsgBoxAnswer = MsgBox(36, "Bomberman", "Möchten sie wirklich Bomberman beenden?")
Select
Case $iMsgBoxAnswer = 6
Exit
EndSelect
Case $Button[3]
Exit
Case $Button[0]
SoundPlay("")
For $i = 0 To 9
GUICtrlDelete($Button[$i])
Next
_Bar()
_Game()
Case $Button[1]
_Options()
Case $Button[9]
$Read = GUICtrlRead($Button[9])
If $Read = "U" Then
GUICtrlSetData($Button[9], "V")
SoundSetWaveVolume(0)
ElseIf $Read = "V" Then
GUICtrlSetData($Button[9], "U")
SoundSetWaveVolume(100)
EndIf
EndSwitch
WEnd
Func _Game()
_DelRedBomb()
_DelBlueBomb()
Dim $RedBomb[12][3]
Dim $BlueBomb[12][3]
_OpenMap($Path[3])
$Red[1] = 30
$Red[2] = 120
$Red[0] = GUICtrlCreateLabel("", $Red[1], $Red[2], 30, 30)
$Red[4] = False
$Red[5] = False
$Red[6] = False
GUICtrlSetBkColor($Red[0], 0xFF0000)
$Blue[1] = $Width - 60
$Blue[2] = $Height - 60
$Blue[0] = GUICtrlCreateLabel("", $Blue[1], $Blue[2], 30, 30)
$Blue[4] = False
$Blue[5] = False
$Blue[6] = False
GUICtrlSetBkColor($Blue[0], 0x0000FF)
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
$iMsgBoxAnswer = MsgBox(36, "Bomberman", "Möchten sie wirklich Bomberman beenden?")
Select
Case $iMsgBoxAnswer = 6
Exit
EndSelect
EndSwitch
If _IsPressed(44) = 1 Then
If $Red[1] <> $Width - 30 Then _Red("rechts")
EndIf
If _IsPressed(41) = 1 Then
If $Red[1] <> 0 Then _Red("links")
EndIf
If _IsPressed(57) = 1 Then
If $Red[2] <> 90 Then _Red("oben")
EndIf
If _IsPressed(53) = 1 Then
If $Red[2] <> $Height - 30 Then _Red("unten")
EndIf
If _IsPressed(27) = 1 Then
If $Blue[1] <> $Width - 30 Then _Blue("rechts")
EndIf
If _IsPressed(25) = 1 Then
If $Blue[1] <> 0 Then _Blue("links")
EndIf
If _IsPressed(26) = 1 Then
If $Blue[2] <> 90 Then _Blue("oben")
EndIf
If _IsPressed(28) = 1 Then
If $Blue[2] <> $Height - 30 Then _Blue("unten")
EndIf
If _IsPressed("A1") = 1 Then
If $Blue[4] <> True Then
$Blue[4] = True
$BlueBomb[11][0] = GUICtrlCreatePic($Path[11] & "Bomb.jpg", $Blue[1], $Blue[2], 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$BlueBomb[11][1] = $Blue[1]
$BlueBomb[11][2] = $Blue[2]
AdlibRegister("_BlueBomb", 500)
EndIf
EndIf
If _IsPressed(20) = 1 Then
If $Red[4] <> True Then
$Red[4] = True
$RedBomb[11][0] = GUICtrlCreatePic($Path[11] & "Bomb.jpg", $Red[1], $Red[2], 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$RedBomb[11][1] = $Red[1]
$RedBomb[11][2] = $Red[2]
AdlibRegister("_RedBomb", 500)
EndIf
EndIf
If $Red[6] = True Then
AdlibRegister("_DelRedBomb", 700)
$Red[6] = False
EndIf
If $Blue[6] = True Then
AdlibRegister("_DelBlueBomb", 700)
$Blue[6] = False
EndIf
If $Blue[5] = True Or $Red[5] = True Then
For $t = 2 To 10
If $Blue[1] = $BlueBomb[0][0] + $Value[$t][0] And $Blue[2] = $BlueBomb[1][0] + $Value[$t][1] Then
$Red[7] = $Red[7] + 1
GUICtrlSetData($Red[8], $Red[7])
_Restart()
EndIf
If $Red[5] = True Then
If $Blue[1] = $RedBomb[0][0] + $Value[$t][0] And $Blue[2] = $RedBomb[1][0] + $Value[$t][1] Then
$Red[7] = $Red[7] + 1
GUICtrlSetData($Red[8], $Red[7])
_Restart()
EndIf
EndIf
Next
EndIf
If $Red[5] = True Or $Blue[5] = True Then
For $t = 2 To 10
If $Red[1] = $RedBomb[0][0] + $Value[$t][0] And $Red[2] = $RedBomb[1][0] + $Value[$t][1] Then
$Blue[7] = $Blue[7] + 1
GUICtrlSetData($Blue[8], $Blue[7])
_Restart()
EndIf
If $Blue[5] = True Then
If $Red[1] = $BlueBomb[0][0] + $Value[$t][0] And $Red[2] = $BlueBomb[1][0] + $Value[$t][1] Then
$Blue[7] = $Blue[7] + 1
GUICtrlSetData($Blue[8], $Blue[7])
_Restart()
EndIf
EndIf
Next
EndIf
Sleep(30)
WEnd
EndFunc ;==>_Game
Func _OpenMap($Path)
Local $Left = 0
Local $Top = 90
Local $File = FileOpen($Path, 0)
Local $ReadFile = FileRead($Path)
FileClose($Path)
$String = StringSplit($ReadFile, ".")
For $i = 1 To UBound($String) - 1
If $Left = $Width Then
$Left = 0
$Top = $Top + 30
EndIf
If $String[$i] = 2 Then
$Object[$i][0] = GUICtrlCreatePic($Wall, $Left, $Top, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Object[$i][1] = $Left
$Object[$i][2] = $Top
EndIf
$Left = $Left + 30
Next
EndFunc ;==>_OpenMap
Func _Red($Direction)
$Red[3] = True
For $i = 0 To UBound($Object) - 1
If $Red[1] = $Object[$i][1] - 30 And $Red[2] = $Object[$i][2] Then $Red[3] = False
Next
If $Direction = "rechts" And $Red[3] <> False Then $Red[1] = $Red[1] + 30
$Red[3] = True
For $i = 0 To UBound($Object) - 1
If $Red[1] = $Object[$i][1] + 30 And $Red[2] = $Object[$i][2] Then $Red[3] = False
Next
If $Direction = "links" And $Red[3] <> False Then $Red[1] = $Red[1] - 30
$Red[3] = True
For $i = 0 To UBound($Object) - 1
If $Red[2] = $Object[$i][2] - 30 And $Red[1] = $Object[$i][1] Then $Red[3] = False
Next
If $Direction = "unten" And $Red[3] <> False Then $Red[2] = $Red[2] + 30
$Red[3] = True
For $i = 0 To UBound($Object) - 1
If $Red[2] = $Object[$i][2] + 30 And $Red[1] = $Object[$i][1] Then $Red[3] = False
Next
If $Direction = "oben" And $Red[3] <> False Then $Red[2] = $Red[2] - 30
GUICtrlSetPos($Red[0], $Red[1], $Red[2])
EndFunc ;==>_Red
Func _Blue($Direction)
$Blue[3] = True
For $i = 0 To UBound($Object) - 1
If $Blue[1] = $Object[$i][1] - 30 And $Blue[2] = $Object[$i][2] Then $Blue[3] = False
Next
If $Direction = "rechts" And $Blue[3] <> False Then $Blue[1] = $Blue[1] + 30
$Blue[3] = True
For $i = 0 To UBound($Object) - 1
If $Blue[1] = $Object[$i][1] + 30 And $Blue[2] = $Object[$i][2] Then $Blue[3] = False
Next
If $Direction = "links" And $Blue[3] <> False Then $Blue[1] = $Blue[1] - 30
$Blue[3] = True
For $i = 0 To UBound($Object) - 1
If $Blue[2] = $Object[$i][2] - 30 And $Blue[1] = $Object[$i][1] Then $Blue[3] = False
Next
If $Direction = "unten" And $Blue[3] <> False Then $Blue[2] = $Blue[2] + 30
$Blue[3] = True
For $i = 0 To UBound($Object) - 1
If $Blue[2] = $Object[$i][2] + 30 And $Blue[1] = $Object[$i][1] Then $Blue[3] = False
Next
If $Direction = "oben" And $Blue[3] <> False Then $Blue[2] = $Blue[2] - 30
GUICtrlSetPos($Blue[0], $Blue[1], $Blue[2])
EndFunc ;==>_Blue
Func _RedBomb()
SoundPlay($Path[1])
AdlibUnRegister("_RedBomb")
GUICtrlDelete($RedBomb[11][0])
$RedBomb[0][0] = $RedBomb[11][1]
$RedBomb[1][0] = $RedBomb[11][2]
For $i = 2 To 10
$RedBomb[$i][1] = True
Next
For $i = 0 To UBound($Object) - 1
For $i2 = 2 To 10
If $RedBomb[0][0] + $Value[$i2][0] = $Object[$i][1] And $RedBomb[1][0] = $Object[$i][2] + $Value[$i2][1] Then
$RedBomb[$i2][0] = False
GUICtrlDelete($Object[$i][0])
$Object[$i][1] = ""
$Object[$i][2] = ""
EndIf
Next
Next
For $i = 2 To 10
If $RedBomb[$i][1] <> False Then
$RedBomb[$i][0] = GUICtrlCreatePic($Value[$i][2], $RedBomb[0][0] + $Value[$i][0], $RedBomb[1][0] + $Value[$i][1], 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$RedBomb[$i][1] = $RedBomb[0][0] + $Value[$i][0]
$RedBomb[$i][2] = $RedBomb[1][0] + $Value[$i][1]
EndIf
Next
$Red[5] = True
$Red[4] = False
$Red[6] = True
EndFunc ;==>_RedBomb
Func _BlueBomb()
SoundPlay($Path[1])
AdlibUnRegister("_BlueBomb")
GUICtrlDelete($BlueBomb[11][0])
$BlueBomb[0][0] = $BlueBomb[11][1]
$BlueBomb[1][0] = $BlueBomb[11][2]
For $i = 2 To 10
$BlueBomb[$i][1] = True
Next
For $i = 0 To UBound($Object) - 1
For $i2 = 2 To 10
If $BlueBomb[0][0] + $Value[$i2][0] = $Object[$i][1] And $BlueBomb[1][0] = $Object[$i][2] + $Value[$i2][1] Then
$BlueBomb[$i2][0] = False
GUICtrlDelete($Object[$i][0])
$Object[$i][1] = ""
$Object[$i][2] = ""
EndIf
Next
Next
For $i = 2 To 10
If $BlueBomb[$i][1] <> False Then
$BlueBomb[$i][0] = GUICtrlCreatePic($Value[$i][2], $BlueBomb[0][0] + $Value[$i][0], $BlueBomb[1][0] + $Value[$i][1], 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$BlueBomb[$i][1] = $BlueBomb[0][0] + $Value[$i][0]
$BlueBomb[$i][2] = $BlueBomb[1][0] + $Value[$i][1]
EndIf
Next
$Blue[5] = True
$Blue[4] = False
$Blue[6] = True
EndFunc ;==>_BlueBomb
Func _DelBlueBomb()
AdlibUnRegister("_DelBlueBomb")
$Blue[5] = False
For $i = 2 To 10
GUICtrlDelete($BlueBomb[$i][0])
Next
EndFunc ;==>_DelBlueBomb
Func _DelRedBomb()
AdlibUnRegister("_DelRedBomb")
$Red[5] = False
For $i = 2 To 10
GUICtrlDelete($RedBomb[$i][0])
Next
EndFunc ;==>_DelRedBomb
Func _Restart()
For $i = 0 To UBound($String) - 1
GUICtrlDelete($Object[$i][0])
Next
GUICtrlDelete($Blue[0])
GUICtrlDelete($Red[0])
_Game()
EndFunc ;==>_Restart
Func _Options()
$Options[0] = GUICreate("Options", 434, 266)
GUISetBkColor(0x9D9D9D)
$Options[1] = GUICtrlCreateButton("Cancel", 312, 224, 115, 33)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Options[2] = GUICtrlCreateButton("OK", 192, 224, 115, 33)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Map:", 16, 24, 39, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Style:", 16, 104, 43, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$Options[3] = GUICtrlCreateInput("", 72, 24, 345, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Options[4] = GUICtrlCreateInput("", 72, 104, 345, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Options[5] = GUICtrlCreateButton("Restore to Default", 312, 56, 107, 25)
$Options[6] = GUICtrlCreateButton("Restore to Default", 312, 136, 107, 25)
$Options[7] = GUICtrlCreateButton("Choose style", 232, 136, 75, 25)
$Options[8] = GUICtrlCreateButton("Choose map", 232, 56, 75, 25)
$Options[9] = GUICtrlCreateButton("Open Options file", 296, 184, 123, 25)
GUICtrlCreateGroup("", 8, 8, 417, 209)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetData($Options[3], IniRead($Path[8], "General", "Map", ""))
GUICtrlSetData($Options[4], IniRead($Path[8], "General", "Style", ""))
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Options[7]
$Options[10] = FileOpenDialog("Choose style", @ScriptDir & "\Styles", "Bomberman style (*.bms)", 1)
If Not @error Then
GUICtrlSetData($Options[4], $Options[10])
EndIf
Case $Options[8]
$Options[10] = FileOpenDialog("Choose map", @ScriptDir & "\Maps", "Bomberman map (*.bml)", 1)
If Not @error Then
GUICtrlSetData($Options[3], $Options[10])
EndIf
Case $Options[9]
ShellExecute($Path[8])
Case $Options[5]
GUICtrlSetData($Options[3], IniRead($Path[8], "General", "StandardMap", ""))
Case $Options[6]
GUICtrlSetData($Options[4], IniRead($Path[8], "General", "StandardStyle", ""))
Case $GUI_EVENT_CLOSE
GUIDelete($Options[0])
ExitLoop
Case $Options[2]
IniWrite($Path[8], "General", "Map", GUICtrlRead($Options[3]))
IniWrite($Path[8], "General", "Style", GUICtrlRead($Options[4]))
$Path[0] = @ScriptDir & "/Sounds/Sound.mp3"
$Path[2] = IniRead(@ScriptDir & "/Options.ini", "General", "Style", "")
$Path[3] = IniRead(@ScriptDir & "/Options.ini", "General", "Map", "")
$Path[11] = _Style($Path[2])
$Value[2][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[3][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[4][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[5][2] = $Path[11] & "ExplosionRightLeft.jpg"
$Value[6][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[7][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[8][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[9][2] = $Path[11] & "ExplosionTopButtom.jpg"
$Value[10][2] = $Path[11] & "ExplosionMiddle.jpg"
Global $Wall = $Path[11] & "Wall.jpg"
GUIDelete($Options[0])
ExitLoop
Case $Options[1]
GUIDelete($Options[0])
ExitLoop
EndSwitch
WEnd
EndFunc ;==>_Options
Func _Style($Path)
Local $File = FileOpen($Path, 0)
Local $ReadFile = FileRead($File)
FileClose($File)
Return @ScriptDir & "\" & $ReadFile
EndFunc ;==>_Style
Func _Bar()
$Blue[7] = 0
$Red[7] = 0
GUICtrlCreateLabel("", 30, 30, 30, 30, -1, $WS_EX_STATICEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlCreateLabel("", 120, 30, 30, 30, -1, $WS_EX_STATICEDGE)
GUICtrlSetBkColor(-1, 0x0000FF)
$Blue[8] = GUICtrlCreateLabel($Blue[7], 150, 30, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($Blue[8], 0x000000)
GUICtrlSetColor($Blue[8], 0xFFFFFF)
GUICtrlSetFont($Blue[8], 18, 800, 0, "Myriad Pro")
$Red[8] = GUICtrlCreateLabel($Red[7], 60, 30, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($Red[8], 0x000000)
GUICtrlSetColor($Red[8], 0xFFFFFF)
GUICtrlSetFont($Red[8], 18, 800, 0, "Myriad Pro")
EndFunc ;==>_Bar
Editor
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
Opt("MouseCoordMode", 2)
Dim $GUI[100]
Dim $Object[433][4]
$Zufall = False
$GUI[0] = GUICreate("Editor", 178, 314, 0, 0, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetBkColor(0x9D9D9D)
$GUI[1] = GUICtrlCreatePic(@ScriptDir & "\Styles\Standard\Wall.jpg", 16, 64, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$GUI[2] = GUICtrlCreatePic(@ScriptDir & "\Styles\Standard\Wall.jpg", 16, 104, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$GUI[3] = GUICtrlCreatePic(@ScriptDir & "\Styles\Standard\Wall.jpg", 16, 24, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUICtrlCreateGroup("", 8, 8, 161, 137)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GUI[4] = GUICtrlCreateButton("Neue Map", 8, 152, 163, 25)
$GUI[5] = GUICtrlCreateButton("Map öffnen", 8, 184, 163, 25)
$GUI[6] = GUICtrlCreateButton("Map speichern", 8, 216, 163, 25)
$GUI[7] = GUICtrlCreateButton("Zufall", 8, 248, 163, 25)
$GUI[8] = GUICtrlCreateButton("Beenden", 8, 280, 163, 25)
GUISetState(@SW_SHOW)
$GUI[9] = GUICreate("Editor", 720, 540)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI[5]
$Path = FileOpenDialog("Open map", @ScriptDir & "\Maps", "Bomberman map (*.bml)", 1)
If Not @error Then
If $Zufall = True Then
For $i = 1 To 432
GUICtrlDelete($Object[$i][0])
$Object[$i][3] = False
Next
EndIf
$Left = 0
$Top = 0
$File = FileOpen($Path, 0)
$ReadFile = FileRead($Path)
FileClose($Path)
$String = StringSplit($ReadFile, ".")
For $i = 1 To UBound($String) - 1
If $String[$i] = 2 Then
$Object[$i][3] = True
$Object[$i][0] = GUICtrlCreatePic(@ScriptDir & "\Styles\Standard\Wall.jpg", $Left, $Top, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
EndIf
$Object[$i][1] = $Left
$Object[$i][2] = $Top
$Left = $Left + 30
If $Left = 720 Then
$Left = 0
$Top = $Top + 30
EndIf
Next
$Zufall = True
EndIf
Case $GUI[8]
Exit
Case $GUI[4]
For $i = 1 To 432
GUICtrlDelete($Object[$i][0])
$Object[$i][3] = False
Next
Case $GUI[7]
If $Zufall = True Then
For $i = 1 To 432
GUICtrlDelete($Object[$i][0])
$Object[$i][3] = False
Next
EndIf
$Zufall = True
$Left = 0
$Top = 0
For $i = 1 To 432
If Random() < 0.5 Then
$Object[$i][0] = GUICtrlCreatePic(@ScriptDir & "\Styles\Standard\Wall.jpg", $Left, $Top, 30, 30, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Object[$i][3] = True
EndIf
$Object[$i][1] = $Left
$Object[$i][2] = $Top
$Left = $Left + 30
If $Left = 720 Then
$Left = 0
$Top = $Top + 30
EndIf
Next
Case $GUI[6]
$Path = FileSaveDialog("Save map", @ScriptDir & "\Maps", "Bomberman map (*.bml)")
If Not @error Then
$Ergebnis = ""
For $i = 1 To 432
If $Object[$i][3] = True Then
If $i <> 432 Then
$Cache = "2."
Else
$Cache = "2"
EndIf
Else
If $i <> 432 Then
$Cache = "1."
Else
$Cache = "1"
EndIf
EndIf
$Ergebnis = $Ergebnis & $Cache
Next
If StringRight($Path, 4) = ".bml" Then
$File = FileOpen($Path, 2)
FileWrite($File, $Ergebnis)
FileClose($File)
Else
$File = FileOpen($Path, 2)
FileWrite($Path & ".bml", $Ergebnis)
FileClose($File)
EndIf
EndIf
EndSwitch
WEnd