Klappe die 2.!
Ich habe jetzt folgendes Skript relativ weit gebracht.
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.8.1
Author: myName
Script Function:
Template AutoIt script.
ID-Liste
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]-3 => Monster 3
-2 => Monster 2
-1 => Monster 1
0 => Leeres Feld/Gras
1 => Spieler Position
2 => Wand/Fels/Berg
3 => Spieler Upgrade
4 => Item
5 => Quest
#ce ----------------------------------------------------------------------------
#include <GuiConstants.au3>
#include <GDIPlus.au3>
Global $Map_Line1,$Map_Line2,$Map_Line3,$Map_Line4,$Map_Line5,$Map_Line6,$Map_Line7
Global $player, $stein, $gras
$GuiWidth = 400
$GuiHeight = 500
$Width = 100
$Height = 100
$PlayerPosX = 49
$PlayerPosY = 49
Dim $aMap[$Width][$Height]
Dim $Show[7][7]
If FileExists(@ScriptDir & "\Map_X.ini") == 1 Then
For $i = 0 To $Width - 1 Step 1
For $i2 = 0 To $Height - 1 Step 1
$aMap[$i][$i2] = IniRead("Map_X.ini","Map","$aMap[" & $i & "][" & $i2 & "]",0)
Next
Next
Else
If FileExists(@ScriptDir & "\Map_X.ini") == 0 Then
For $i = 0 To $Width - 1 Step 1
For $i2 = 0 To $Height - 1 Step 1
$aMap[$i][$i2] = 0
IniWrite("Map_X.ini","Map","$aMap[" & $i & "][" & $i2 & "]",$aMap[$i][$i2])
Next
Next
For $i = 0 To $Width - 1 Step 1
$aMap[$i][0] = 2
$aMap[$i][$Height - 1] = 2
IniWrite("Map_X.ini","Map","$aMap[" & $i & "][0]",$aMap[$i][0])
IniWrite("Map_X.ini","Map","$aMap[" & $i & "][" & $Height - 1 & "]",$aMap[$i][$Height - 1])
Next
For $i = 0 To $Height - 1 Step 1
$aMap[0][$i] = 2
$aMap[$Width - 1][$i] = 2
IniWrite("Map_X.ini","Map","$aMap[0][" & $i & "]",$aMap[0][$i])
IniWrite("Map_X.ini","Map","$aMap[" & $Width - 1 & "][" & $i & "]",$aMap[$Width - 1][$i])
Next
EndIf
EndIf
$aMap[$PlayerPosX][$PlayerPosY] = 1
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hGui = GUICreate("MyGui",$GuiWidth,$GuiHeight)
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
;$Bitmap = _GDIPlus_BitmapCreateFromGraphics($GuiWidth, $GuiHeight, $hGraphics)
;$Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
$hBtn_W = GUICtrlCreateButton(ChrW(8593),190,400,30,30)
$hBtn_A = GUICtrlCreateButton(ChrW(8592),160,430,30,30)
$hBtn_S = GUICtrlCreateButton(ChrW(8595),190,460,30,30)
$hBtn_D = GUICtrlCreateButton(ChrW(8594),220,430,30,30)
$hLabel_Main = GUICtrlCreateLabel("test",10,10,380,290)
;GUICtrlSetState($hLabel_Main,$GUI_HIDE)
GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]$gras = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\gras.png")
$stein = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\stein.png")
$player = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\player.png")
_Draw($hGraphics)
[/autoit] [autoit][/autoit] [autoit]While Sleep(10)
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_GDIPlus_GraphicsClear($hGraphics)
_GDIPlus_GraphicsDispose($hGraphics)
;_GDIPlus_BitmapDispose($Bitmap)
_GDIPlus_Shutdown()
Exit
Case $hBtn_A
_Btn_A()
;_Check_Button($hBtn_W, $hBtn_A, $hBtn_S, $hBtn_D)
_Draw($hGraphics)
Case $hBtn_D
_Btn_D()
;_Check_Button($hBtn_W, $hBtn_A, $hBtn_S, $hBtn_D)
_Draw($hGraphics)
Case $hBtn_S
_Btn_S()
;_Check_Button($hBtn_W, $hBtn_A, $hBtn_S, $hBtn_D)
_Draw($hGraphics)
Case $hBtn_W
_Btn_W()
;_Check_Button($hBtn_W, $hBtn_A, $hBtn_S, $hBtn_D)
_Draw($hGraphics)
EndSwitch
ToolTip("X:" & $PlayerPosX & @CRLF & "Y:" & $PlayerPosY & @CRLF & $aMap[$PlayerPosX - 1][$PlayerPosY - 1] & $aMap[$PlayerPosX][$PlayerPosY - 1] & $aMap[$PlayerPosX + 1][$PlayerPosY - 1] & @CRLF & $aMap[$PlayerPosX - 1][$PlayerPosY] & $aMap[$PlayerPosX][$PlayerPosY] & $aMap[$PlayerPosX + 1][$PlayerPosY] & @CRLF & $aMap[$PlayerPosX - 1][$PlayerPosY + 1] & $aMap[$PlayerPosX][$PlayerPosY + 1] & $aMap[$PlayerPosX + 1][$PlayerPosY + 1])
WEnd
Func _Draw($hGraphic)
Local $Str, $Str2
_Check_Button($hBtn_W, $hBtn_A, $hBtn_S, $hBtn_D)
For $i = 0 To 6 Step 1
_GDIPlus_ImageDispose($Show[$i][0])
$Str = StringTrimLeft($Map_Line1,$i)
$Str2 = StringTrimRight($Str, 6 - $i)
If StringLen($Str2) > 1 Then Return -1
Switch $i
Case 0
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,25,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,25,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,25,25,50,50)
EndIf
EndIf
EndIf
Case 1
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,75,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,75,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,75,25,50,50)
EndIf
EndIf
EndIf
Case 2
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,125,25,50,50)
MsgBox(0,"",$i & " gras")
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,125,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,125,25,50,50)
EndIf
EndIf
EndIf
Case 3
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,175,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,175,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,175,25,50,50)
EndIf
EndIf
EndIf
Case 4
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,225,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,225,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,225,25,50,50)
EndIf
EndIf
EndIf
Case 5
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,275,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,275,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,275,25,50,50)
EndIf
EndIf
EndIf
Case 6
If $Str2 == 0 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$gras,325,25,50,50)
Else
If $Str2 == 1 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$player,325,25,50,50)
Else
If $Str2 == 2 Then
$Show[$i][0] = _GDIPlus_GraphicsDrawImageRect($hGraphic,$stein,325,25,50,50)
EndIf
EndIf
EndIf
EndSwitch
Next
;_GDIPlus_GraphicsDrawImage($hGraphics,$Buffer,0,0)
EndFunc
Func _Btn_W()
$aMap[$PlayerPosX][$PlayerPosY] = 0
$PlayerPosY -= 1
$aMap[$PlayerPosX][$PlayerPosY] = 1
EndFunc
Func _Btn_S()
$aMap[$PlayerPosX][$PlayerPosY] = 0
$PlayerPosY += 1
$aMap[$PlayerPosX][$PlayerPosY] = 1
EndFunc
Func _Btn_D()
$aMap[$PlayerPosX][$PlayerPosY] = 0
$PlayerPosX += 1
$aMap[$PlayerPosX][$PlayerPosY] = 1
EndFunc
Func _Btn_A()
$aMap[$PlayerPosX][$PlayerPosY] = 0
$PlayerPosX -= 1
$aMap[$PlayerPosX][$PlayerPosY] = 1
EndFunc
Func _Check_Button($Bt1, $Bt2, $Bt3, $Bt4)
If $PlayerPosX == 1 Then
GUICtrlSetState($Bt2,$GUI_DISABLE)
Else
GUICtrlSetState($Bt2,$GUI_ENABLE)
EndIf
If $PlayerPosX == $Width - 2 Then
GUICtrlSetState($Bt4,$GUI_DISABLE)
Else
GUICtrlSetState($Bt4,$GUI_ENABLE)
EndIf
If $PlayerPosY == 1 Then
GUICtrlSetState($Bt1,$GUI_DISABLE)
Else
GUICtrlSetState($Bt1,$GUI_ENABLE)
EndIf
If $PlayerPosY == $Height - 2 Then
GUICtrlSetState($Bt3,$GUI_DISABLE)
Else
GUICtrlSetState($Bt3,$GUI_ENABLE)
EndIf
If $PlayerPosY - 3 < 0 Then
$Map_Line1 = ""
Else
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line1 = $aMap[$PlayerPosX - 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 3]
Else
$Map_Line1 = $aMap[$PlayerPosX - 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 3]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line1 = $aMap[$PlayerPosX - 3][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 3]
Else
$Map_Line1 = $aMap[$PlayerPosX - 3][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 3]
EndIf
Else
$Map_Line1 = $aMap[$PlayerPosX - 3][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 3]
EndIf
EndIf
EndIf
If $PlayerPosY - 2 < 0 Then
$Map_Line2 = ""
Else
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line2 = $aMap[$PlayerPosX - 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 2]
Else
$Map_Line2 = $aMap[$PlayerPosX - 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 2]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line2 = $aMap[$PlayerPosX - 3][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 2]
Else
$Map_Line2 = $aMap[$PlayerPosX - 3][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 2]
EndIf
Else
$Map_Line2 = $aMap[$PlayerPosX - 3][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 2]
EndIf
EndIf
EndIf
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line3 = $aMap[$PlayerPosX - 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 1]
Else
$Map_Line3 = $aMap[$PlayerPosX - 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 1]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line3 = $aMap[$PlayerPosX - 3][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 1]
Else
$Map_Line3 = $aMap[$PlayerPosX - 3][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 1]
EndIf
Else
$Map_Line3 = $aMap[$PlayerPosX - 3][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 1]
EndIf
EndIf
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line4 = $aMap[$PlayerPosX - 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 0]
Else
$Map_Line4 = $aMap[$PlayerPosX - 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 0]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line4 = $aMap[$PlayerPosX - 3][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 0]
Else
$Map_Line4 = $aMap[$PlayerPosX - 3][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 0]
EndIf
Else
$Map_Line4 = $aMap[$PlayerPosX - 3][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY - 0] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY - 0]
EndIf
EndIf
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line5 = $aMap[$PlayerPosX - 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 1]
Else
$Map_Line5 = $aMap[$PlayerPosX - 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 1]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line5 = $aMap[$PlayerPosX - 3][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 1]
Else
$Map_Line5 = $aMap[$PlayerPosX - 3][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 1]
EndIf
Else
$Map_Line5 = $aMap[$PlayerPosX - 3][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 1] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 1]
EndIf
EndIf
If $PlayerPosY + 2 > $Height - 1 Then
$Map_Line6 = ""
Else
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line6 = $aMap[$PlayerPosX - 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 2]
Else
$Map_Line6 = $aMap[$PlayerPosX - 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 2]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line6 = $aMap[$PlayerPosX - 3][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 2]
Else
$Map_Line6 = $aMap[$PlayerPosX - 3][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 2]
EndIf
Else
$Map_Line6 = $aMap[$PlayerPosX - 3][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 2] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 2]
EndIf
EndIf
EndIf
If $PlayerPosY + 3 > $Height - 1 Then
$Map_Line7 = ""
Else
If $PlayerPosX - 3 < 0 Then
If $PlayerPosX - 2 < 0 Then
$Map_Line7 = $aMap[$PlayerPosX - 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 3]
Else
$Map_Line7 = $aMap[$PlayerPosX - 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 3]
EndIf
Else
If $PlayerPosX + 3 > $Width - 1 Then
If $PlayerPosX + 2 > $Width - 1 Then
$Map_Line7 = $aMap[$PlayerPosX - 3][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 3]
Else
$Map_Line7 = $aMap[$PlayerPosX - 3][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 3]
EndIf
Else
$Map_Line7 = $aMap[$PlayerPosX - 3][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX - 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 1][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 2][$PlayerPosY + 3] & " " & _
$aMap[$PlayerPosX + 3][$PlayerPosY + 3]
EndIf
EndIf
EndIf
GUICtrlSetData($hLabel_Main,$Map_Line1 & @CRLF & _
$Map_Line2 & @CRLF & _
$Map_Line3 & @CRLF & _
$Map_Line4 & @CRLF & _
$Map_Line5 & @CRLF & _
$Map_Line6 & @CRLF & _
$Map_Line7 & @CRLF)
EndFunc
Nun hab ich aber das Problem, dass wenn ich eine Button drücke möchte ich dass die Aktuelle Map mit allen "Hindernissen" dargestellt wird.
Wenn ich einen Button drücke führe ich die Funktion _Draw() aus um anhand der _CheckButtons Funktion, die die Map 7 Punkte um den Spieler "Berechnet", alle "Hindernisse" herauszufinden und dann darstellen zu lassen. Ich habe das jetzt nur für die erste Reihe der 7x7 fläche gemacht, sprich die als X markierte Stellen:
XXXXXXX
ooooooo
ooooooo
ooooooo
ooooooo
ooooooo
ooooooo
Nur wird das alles nicht auf die Grafik gezeichnet. Ich weiß nicht woran es liegen könnte.
VIelen Dank für alle Hilfe.