Tower Defense A2D.udf A-Stern

  • Guten Abend,

    ich möchte hier die Beta Version meines Tower Defence Spiel vorstellen. Als Grafikschnittstelle habe ich die A2D.ufd genutzt, da mir Gdiplus zu langsam ist. Die Steuerung: Mit den Tasten 1 bis 5 kann man den Turm auswählen. Ist ein Turm gebaut kann man ihn anklicken und updaten oder löschen.

    Also hier ist dann noch das Script:

    Spoiler anzeigen
    [autoit]

    #include <GuiConstants.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include <Sound.au3>
    #include <Misc.au3>
    #include <Array.au3>
    #include <Timers.au3>
    #include <gebaeude.au3>
    #include <OpenGLconstants.au3>
    #include <OpenGLfunctions.au3>
    #include <A-Stern.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GuiOnEventMode', 1)
    Opt('MouseCoordMode', 0)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $width = 640, $height = 480
    ;Global Const $width = @DesktopWidth, $height = @DesktopHeight

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $felder_x = 16, $felder_y = 12
    Global Const $feld_x = $width / $felder_x, $feld_y = $height / $felder_y
    Global Const $feld_scale_x = 2 / $felder_x, $feld_scale_y = 2 / $felder_y

    [/autoit] [autoit][/autoit] [autoit]

    Global $KeyboardState
    Global $Rotation

    [/autoit] [autoit][/autoit] [autoit]

    Global $Startpunkt[2] = [0,0]
    Global $Zielpunkt[2] = [15,11]

    [/autoit] [autoit][/autoit] [autoit]

    Global $Hindernisse[$felder_x][$felder_y]
    Global $Weg_Punkte, $Weg_Punkte_Backup

    [/autoit] [autoit][/autoit] [autoit]

    Global $Geld = 1000
    Global $Leben = 20

    [/autoit] [autoit][/autoit] [autoit]

    Global $next_round

    [/autoit] [autoit][/autoit] [autoit]

    Global $Bot[1]
    Global $Bot_Pos[1][2]
    Global $Bot_Move[1][2]
    Global $Bot_Wegpunkt[1]
    Global $Bot_Leben[1]
    Global $Bot_Speed[1][2]
    Global $Bot_Gift[1][2]
    Global $Bot_Particle_type[1]

    [/autoit] [autoit][/autoit] [autoit]

    Global $Bots_Next
    Global $Bots_Anzahl = 5
    Global $Bots_Alive = 5
    Global $Bots_Wave

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Gebaeude_Name[5] = ["Gun","Gift","Speed","Freeze","Dawn"]
    Global Const $Gebaeude_Kosten[5][3] = [[10,20,40],[15,40,100],[20,50,150],[25,75,180],[50,100,250]]
    Global Const $Gebaeude_Damage[5][3] = [[5,15,40],[1,2,10],[5,20,50],[1,2,10],[30,80,200]]
    Global Const $Gebaeude_Reichweite[5][3] = [[10,20,40],[10,15,25],[10,20,40],[10,15,25],[20,40,50]]
    Global Const $Gebaeude_Feuerrate[5][3] = [[1,1,1.5],[1,1,1.5],[2,4,8],[0.5,0.5,1],[0.5,0.5,1]]
    Global Const $Gebaeude_Freeze[5][3] = [[1,1,1],[1,1,1],[1,1,1],[0.5,0.25,0.125],[1,1,1]]
    Global Const $Gebaeude_Gift[5][3] = [[0,0,0],[5,20,50],[0,0,0],[0,0,0],[0,0,0]]
    Global Const $Gebaeude_Schuss_type[5] = [1,0,1,0,2]

    [/autoit] [autoit][/autoit] [autoit]

    Global $Gebaeude_Type[$felder_x][$felder_y]
    Global $Gebaeude_Timer[$felder_x][$felder_y]
    Global $Gebaeude_Update[$felder_x][$felder_y]

    [/autoit] [autoit][/autoit] [autoit]

    Global $schuss_array[1][7]
    Global Const $type_strahl = 0, $type_points = 1, $type_lines = 2

    [/autoit] [autoit][/autoit] [autoit]

    Global $particle_array[1][6]
    Global Const $type_spred = 0, $type_doublespred = 1, $type_spred_lines = 2, $type_doublespred_lines = 3

    [/autoit] [autoit][/autoit] [autoit]

    ;DEV Varibales

    [/autoit] [autoit][/autoit] [autoit]

    Global $schuss_timer
    Global $string
    Global $gebaeude_zu_bauen
    Global $gebaeude_zu_bearbeiten
    Global $marked_position[2]

    [/autoit] [autoit][/autoit] [autoit]

    Local $mouse_pos[2], $mouse_pos_a[2]

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGUI = GUICreate("Moe´s TD", $width, $height, -1, -1, $WS_POPUP);, $WS_EX_TOPMOST)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_beenden")
    Global $hWnd = WinGetHandle("Moe´s TD")

    [/autoit] [autoit][/autoit] [autoit]

    ;GUIRegisterMsg(0x020A, "_Mousewheel")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    Global $DC
    EnableOpenGL($hGUI, $DC)
    glMatrixMode($GL_PROJECTION)
    ;glEnable($GL_BLEND)

    [/autoit] [autoit][/autoit] [autoit]

    Global $ViewMaus
    Global $ViewPoint_x = 0, $ViewPoint_y = 0
    Global $ViewPort_x = 640, $ViewPort_y = 480

    [/autoit] [autoit][/autoit] [autoit]

    glViewport($ViewPoint_x, $ViewPoint_y, $ViewPort_x, $ViewPort_y)

    [/autoit] [autoit][/autoit] [autoit]

    ;glGenTextures( 1, "texture" )

    [/autoit] [autoit][/autoit] [autoit]

    Local $sxi = $feld_scale_x / 2
    Local $syi = $feld_scale_y / 2

    [/autoit] [autoit][/autoit] [autoit]

    create_gebaeude()
    _Next_Round()

    [/autoit] [autoit][/autoit] [autoit]

    ; Schuss_add($vonx, $vony, $nachx, $nachy, $interval, $type)
    ; particle_add_effect($x, $y, $particle_anzahl, $size, $type)

    [/autoit] [autoit][/autoit] [autoit]

    $weg_punkte = weg($startpunkt[0], $startpunkt[1], $zielpunkt[0], $zielpunkt[1], $felder_x, $felder_y, $hindernisse, False)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $frames = 25

    [/autoit] [autoit][/autoit] [autoit]

    Local $c

    [/autoit] [autoit][/autoit] [autoit]

    AdlibEnable("Main", $frames)

    [/autoit] [autoit][/autoit] [autoit]

    While True
    Sleep(1000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Main()

    [/autoit] [autoit][/autoit] [autoit]

    $KeyboardState = _WinAPI_GetKeyboardState()

    [/autoit] [autoit][/autoit] [autoit]

    ;View()
    ;glViewport($ViewPoint_x + $ViewPort_x / 4, $ViewPoint_y + $ViewPort_y / 4, $ViewPort_x, $ViewPort_y)

    [/autoit] [autoit][/autoit] [autoit]

    glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT));

    [/autoit] [autoit][/autoit] [autoit]

    If BitAND($KeyboardState[02], 0xF0) = 128 Then Sleep(1000) ;_ArrayDisplay($schuss_array)
    If BitAND($KeyboardState[83], 0xF0) = 128 Then save_map()
    If BitAND($KeyboardState[76], 0xF0) = 128 Then load_map()
    If BitAND($KeyboardState[68], 0xF0) = 128 Then erease_map()

    [/autoit] [autoit][/autoit] [autoit]

    Bauen()
    Bot()

    [/autoit] [autoit][/autoit] [autoit]

    Zeichnen()
    Schieszen()
    particle()

    [/autoit] [autoit][/autoit] [autoit]

    SwapBuffers($dc)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func View()

    [/autoit] [autoit][/autoit] [autoit]

    If BitAND($KeyboardState[1], 0xF0) = 128 Then

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($ViewMaus) Then

    [/autoit] [autoit][/autoit] [autoit]

    $ViewPoint_x += MouseGetPos(0) - $ViewMaus[0]
    $ViewPoint_y -= MouseGetPos(1) - $ViewMaus[1]

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $ViewMaus = MouseGetPos()

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Bauen()

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To 4 Step 1
    If BitAND($KeyboardState[49 + $i], 0xF0) = 128 Then
    $gebaeude_zu_bauen = $i + 1
    $gebaeude_zu_bearbeiten = False
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $mouse_pos = _mouse_feld_pos()

    [/autoit] [autoit][/autoit] [autoit]

    If BitAND($KeyboardState[1], 0xF0) = 128 And IsArray($mouse_pos) Then ; Wenn geklickt wurde und die Maus im Fenster ist
    $gebaeude_zu_bearbeiten = True
    $marked_position[0] = $mouse_pos[0]
    $marked_position[1] = $mouse_pos[1]
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $gebaeude_zu_bauen <> 0 And $gebaeude_zu_bearbeiten = True Then ; Wenn ein Gebäude gebaut werden soll #########################################################################

    [/autoit] [autoit][/autoit] [autoit]

    If $Geld - $Gebaeude_Kosten[$gebaeude_zu_bauen - 1][0] >= 0 Then ; Wenn man genug Geld hat

    [/autoit] [autoit][/autoit] [autoit]

    If $mouse_pos[0] <> $mouse_pos_a[0] Or $mouse_pos[1] <> $mouse_pos_a[1] Then

    [/autoit] [autoit][/autoit] [autoit]

    If $hindernisse[$mouse_pos[0]][$mouse_pos[1]] = False Then ; Wenn kein Gebäude existiert

    [/autoit] [autoit][/autoit] [autoit]

    If ($Startpunkt[0] <> $mouse_pos[0] Or $Startpunkt[1] <> $mouse_pos[1]) And ($Zielpunkt[0] <> $mouse_pos[0] Or $Zielpunkt[1] <> $mouse_pos[1]) Then ; Verhindert das Bauen auf dem Spawnpunkt

    [/autoit] [autoit][/autoit] [autoit]

    $hindernisse[$mouse_pos[0]][$mouse_pos[1]] = True
    $weg_punkte_backup = $weg_punkte
    $weg_punkte = weg($startpunkt[0], $startpunkt[1], $zielpunkt[0], $zielpunkt[1], $felder_x, $felder_y, $hindernisse, False)

    [/autoit] [autoit][/autoit] [autoit]

    If Not IsArray($weg_punkte) Then ; Wenn das Gebäude die Bots blockiert
    $weg_punkte = $weg_punkte_backup
    $hindernisse[$mouse_pos[0]][$mouse_pos[1]] = False
    Else ; Wenn das Gebäude gebaut werden kann
    $Geld -= $Gebaeude_Kosten[$gebaeude_zu_bauen - 1][0]
    ;MsgBox(0,"",$gebaeude_zu_bauen)
    $Gebaeude_Type[$mouse_pos[0]][$mouse_pos[1]] = $gebaeude_zu_bauen
    $Gebaeude_Update[$mouse_pos[0]][$mouse_pos[1]] = 1
    _Bot_Reset()
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $mouse_pos_a = $mouse_pos
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $mouse_pos_a[0] = -1
    $mouse_pos_a[1] = -1
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $gebaeude_zu_bauen = 0
    $gebaeude_zu_bearbeiten = False

    [/autoit] [autoit][/autoit] [autoit]

    ElseIf $gebaeude_zu_bearbeiten Then ; Wenn geupdatet oder gelöscht werden soll ###################################################################################################

    [/autoit] [autoit][/autoit] [autoit]

    If $hindernisse[$marked_position[0]][$marked_position[1]] = True Then
    If BitAND($KeyboardState[85], 0xF0) = 128 Then ; Wenn "u" gedrückt ist

    [/autoit] [autoit][/autoit] [autoit]

    If $Gebaeude_Update[$marked_position[0]][$marked_position[1]] < 3 Then

    [/autoit] [autoit][/autoit] [autoit]

    If $Geld - $Gebaeude_Kosten[$Gebaeude_type[$marked_position[0]][$marked_position[1]] - 1][$Gebaeude_Update[$marked_position[0]][$marked_position[1]] - 1] > 0 Then
    $Geld -= $Gebaeude_Kosten[$Gebaeude_type[$marked_position[0]][$marked_position[1]] - 1][$Gebaeude_Update[$marked_position[0]][$marked_position[1]] - 1]
    $Gebaeude_Update[$marked_position[0]][$marked_position[1]] += 1

    [/autoit] [autoit][/autoit] [autoit]

    $gebaeude_zu_bearbeiten = False
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ElseIf BitAND($KeyboardState[46], 0xF0) = 128 Then ; Wenn "del" gedrückt ist

    [/autoit] [autoit][/autoit] [autoit]

    $hindernisse[$marked_position[0]][$marked_position[1]] = False
    $Gebaeude_type[$marked_position[0]][$marked_position[1]] = 0
    $Gebaeude_update[$marked_position[0]][$marked_position[1]] = 0

    [/autoit] [autoit][/autoit] [autoit]

    $weg_punkte = weg($startpunkt[0], $startpunkt[1], $zielpunkt[0], $zielpunkt[1], $felder_x, $felder_y, $hindernisse, False)

    [/autoit] [autoit][/autoit] [autoit]

    $gebaeude_zu_bearbeiten = False
    EndIf
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Bots_Move()

    [/autoit] [autoit][/autoit] [autoit]

    Local $a, $b, $c

    [/autoit] [autoit][/autoit] [autoit]

    ;If IsArray($weg_punkte) Then

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    If $Bots_Next >= $i Then ; Die Bots kommen nacheinander

    [/autoit] [autoit][/autoit] [autoit]

    If $Bot_Wegpunkt[$i] > UBound($weg_punkte) - 1 Then ; Wenn der Weg neuberechnet wurde und der Bot keinen Wegpunkt mehr hat
    $Bot_Wegpunkt[$i] = 0
    ElseIf $Bot_Wegpunkt[$i] = UBound($weg_punkte) - 1 Then ; Wenn ein Bot das Ziel erreicht hat
    If $Bot_Leben[$i] > 0 Then ; Wenn der Bot noch lebt
    $Bot_Leben[$i] = 0
    $Bots_Alive -= 1
    $Leben -= 1
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $Bot_Speed[$i][0] > _Punkte_Distance($Bot_Pos[$i][0] / 10, $Bot_Pos[$i][1] / 10, $weg_punkte[$Bot_Wegpunkt[$i]][0] - 0.5, $weg_punkte[$Bot_Wegpunkt[$i]][1] - 0.5) Then

    [/autoit] [autoit][/autoit] [autoit]

    If $i = 0 And $Bot_Wegpunkt[$i] > 1 Then $Bots_Next += 1

    [/autoit] [autoit][/autoit] [autoit]

    $Bot_Wegpunkt[$i] += 1
    If $Bot_Wegpunkt[$i] > UBound($weg_punkte) - 1 Then ; Wenn der Bot schein Ziel erreicht hat
    $Bot_Wegpunkt[$i] = 1
    $Bot_Pos[$i][0] = $Zielpunkt[0] * 10
    $Bot_Pos[$i][1] = $Zielpunkt[1] * 10
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $a = $weg_punkte[$Bot_Wegpunkt[$i]][0] * 10 - $Bot_Pos[$i][0]
    $b = $weg_punkte[$Bot_Wegpunkt[$i]][1] * 10 - $Bot_Pos[$i][1]
    $c = Sqrt($a * $a + $b * $b)

    [/autoit] [autoit][/autoit] [autoit]

    $Bot_Move[$i][0] = ($a * $Bot_Speed[$i][0]) / $c
    $Bot_Move[$i][1] = ($b * $Bot_Speed[$i][0]) / $c

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    EndIf
    ;ToolTip("Bot Posiotion: " & $Bot_pos[$i][0] & " & " & $Bot_pos[$i][1] & @LF & $a & " & " & $b & " & " & $c & @LF & "Bot Move: " & $Bot_Move[$i][0] & " & " & $Bot_Move[$i][1] & @LF & "Zielpunkt: " & $weg_punkte[$Bot_Wegpunkt[$i]][0] * 10 & " & " & $weg_punkte[$Bot_Wegpunkt[$i]][1] * 10)
    $Bot_Pos[$i][0] += $Bot_Move[$i][0]
    $Bot_Pos[$i][1] += $Bot_Move[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    ;EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Bot()

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    If $Bot_Speed[$i][1] <> 0 Then
    $Bot_Speed[$i][1] -= 1
    If $Bot_Speed[$i][1] = 0 Then $Bot_Speed[$i][0] = 1 + $Bots_Wave * 0.005
    EndIf
    If $Bot_Gift[$i][1] <> 0 Then
    $Bot_Gift[$i][1] -= 1
    If $Bot_Gift[$i][1] = 0 Then $Bot_Gift[$i][0] = 0
    $Bot_Leben[$i] -= $Bot_Gift[$i][0]
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    If $Bots_Alive > 0 Then
    Bots_Move()
    Tuerme_schieszen()
    $next_round = _Timer_Init()
    ElseIf _Timer_Diff($next_round) > 3000 Then
    _Next_Round()
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Bot_Reset()

    [/autoit] [autoit][/autoit] [autoit]

    $Bots_Next = 0
    $Bots_Alive = $Bots_Anzahl

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    $Bot_Wegpunkt[$i] = 0
    $Bot_Pos[$i][0] = $zielpunkt[0] * 10
    $Bot_Pos[$i][1] = $zielpunkt[1] * 10
    $Bot_Move[$i][0] = 0
    $Bot_Move[$i][1] = 0
    $Bot_Leben[$i] = 10 + $Bots_Wave * 5
    $Bot_Speed[$i][0] = 1 + $Bots_Wave * 0.005
    $Bot_Speed[$i][1] = 0
    $Bot_Gift[$i][0] = 0
    $Bot_Gift[$i][1] = 0

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Tuerme_schieszen()

    [/autoit] [autoit][/autoit] [autoit]

    For $x = 0 To $felder_x - 1 Step 1
    For $y = 0 To $felder_y - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    If $Hindernisse[$x][$y] Then

    [/autoit] [autoit][/autoit] [autoit]

    $Gebaeude_Timer[$x][$y] += 1
    If $Gebaeude_Timer[$x][$y] >= 20 / $Gebaeude_Feuerrate[$Gebaeude_Type[$x][$y] - 1][$Gebaeude_Update[$x][$y] - 1] Then

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    If $Bot_Leben[$i] >= 0 Then
    If _Punkte_Distance($Bot_Pos[$i][0], $Bot_Pos[$i][1], $x * 10, $y * 10) < $Gebaeude_Reichweite[$Gebaeude_Type[$x][$y] - 1][$Gebaeude_Update[$x][$y] - 1] Then

    [/autoit] [autoit][/autoit] [autoit]

    Schuss_add($x, $y, $Bot_Pos[$i][0] / 10, $Bot_Pos[$i][1] / 10, 100, $Gebaeude_Schuss_type[$Gebaeude_Type[$x][$y] - 1])

    [/autoit] [autoit][/autoit] [autoit]

    $Bot_Leben[$i] -= $Gebaeude_Damage[$Gebaeude_Type[$x][$y] - 1][$Gebaeude_Update[$x][$y] - 1]
    $Bot_Speed[$i][0] = $Gebaeude_Freeze[$Gebaeude_Type[$x][$y] - 1][$Gebaeude_Update[$x][$y] - 1]
    $Bot_Speed[$i][1] = 20
    $Bot_Gift[$i][0] = $Gebaeude_Gift[$Gebaeude_Type[$x][$y] - 1][$Gebaeude_Update[$x][$y] - 1]
    $Bot_Gift[$i][1] = 20

    [/autoit] [autoit][/autoit] [autoit]

    If $Bot_Leben[$i] <= 0 Then
    $Bots_Alive -= 1
    particle_add_effect($Bot_Pos[$i][0] / 10, $Bot_Pos[$i][1] / 10, 10, 2, $Bot_Particle_type[$i])
    EndIf
    $Gebaeude_Timer[$x][$y] = 0
    ExitLoop
    EndIf
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    EndIf
    Next
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Next_Round()

    [/autoit] [autoit][/autoit] [autoit]

    Local $var = Random(0,2,1)

    [/autoit] [autoit][/autoit] [autoit]

    $Bots_Next = 0

    [/autoit] [autoit][/autoit] [autoit]

    $Bots_Wave += 1

    [/autoit] [autoit][/autoit] [autoit]

    ReDim $Bot_Pos[$Bots_Anzahl][2]
    ReDim $Bot_Move[$Bots_Anzahl][2]
    ReDim $Bot_Wegpunkt[$Bots_Anzahl]
    ReDim $Bot_Leben[$Bots_Anzahl]
    ReDim $Bot_Speed[$Bots_Anzahl][2]
    ReDim $Bot_Gift[$Bots_Anzahl][2]
    ReDim $Bot_Particle_type[$Bots_Anzahl]

    [/autoit] [autoit][/autoit] [autoit]

    $Bots_Alive = $Bots_Anzahl

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    $Bot_Particle_type[$i] = $var
    $Bot_Wegpunkt[$i] = 0
    $Bot_Pos[$i][0] = $zielpunkt[0] * 10
    $Bot_Pos[$i][1] = $zielpunkt[1] * 10
    $Bot_Move[$i][0] = 0
    $Bot_Move[$i][1] = 0
    $Bot_Leben[$i] = 10 + $Bots_Wave * 5
    $Bot_Speed[$i][0] = 1 + $Bots_Wave * 0.005
    $Bot_Speed[$i][1] = 0
    $Bot_Gift[$i][0] = 0
    $Bot_Gift[$i][1] = 0

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Zeichnen()

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $felder_x - 1 Step 1
    For $j = 0 To $felder_y - 1 Step 1
    If $hindernisse[$i][$j] Then
    Draw_Objekt($Obj_Turm[$Gebaeude_Type[$i][$j] - 1], $i ,$j) ; Zeichnet ein Objekt von entsprechendem Type
    EndIf
    Next
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ;For $i = 0 To UBound($weg_punkte) - 1
    ;_GDIPlus_GraphicsDrawString($Buffer,$i,$weg_punkte[$i][0] * $feld_x,$weg_punkte[$i][1] * $feld_y)
    ;_GDIPlus_GraphicsDrawEllipse($Buffer,$weg_punkte[$i][0] * $feld_x,$weg_punkte[$i][1] * $feld_y,$feld_x,$feld_y)
    ;Next

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Bots_Anzahl - 1 Step 1; (50 - Felder / 2) / 100 * 2
    If $Bot_Leben[$i] > 0 Then
    Draw_Objekt(6, $Bot_pos[$i][0] / 10, $Bot_pos[$i][1] / 10)
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($weg_punkte) - 2 Step 1
    line($weg_punkte[$i][0], $weg_punkte[$i][1], $weg_punkte[$i + 1][0], $weg_punkte[$i + 1][1], 255)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    If $gebaeude_zu_bearbeiten Then
    Draw_Objekt(7, $marked_position[0], $marked_position[1])
    Draw_Objekt(8, $marked_position[0], $marked_position[1])
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Draw_Objekt(1, $Startpunkt[0], $Startpunkt[1])
    Draw_Objekt(1, $Zielpunkt[0], $Zielpunkt[1])

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Schuss_add($vonx, $vony, $nachx, $nachy, $interval, $type)

    [/autoit] [autoit][/autoit] [autoit]

    Local $ubound = UBound($schuss_array)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($schuss_array) Then
    ReDim $schuss_array[$ubound + 1][7]
    Else
    Dim $schuss_array[$ubound + 1][7]
    EndIf
    $schuss_array[$ubound][0] = $vonx
    $schuss_array[$ubound][1] = $vony
    $schuss_array[$ubound][2] = $nachx
    $schuss_array[$ubound][3] = $nachy
    $schuss_array[$ubound][4] = $interval
    $schuss_array[$ubound][5] = $type
    $schuss_array[$ubound][6] = 0

    [/autoit] [autoit][/autoit] [autoit]

    Return $ubound

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Schuss_delete($num)
    _ArrayDelete($schuss_array, $num)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Schieszen()

    [/autoit] [autoit][/autoit] [autoit]

    Local $a, $b ,$c ,$x, $y, $x2, $y2
    Local $rate, $del_list[1]
    Local $speed = 2

    [/autoit] [autoit][/autoit] [autoit]

    If UBound($schuss_array) >= 1 Then ReDim $del_list[UBound($schuss_array)]

    [/autoit] [autoit][/autoit] [autoit]

    $schuss_timer += 1
    If $schuss_timer > 100 Then $schuss_timer = 0

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($schuss_array) - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    Switch $schuss_array[$i][5] ; Type/Art des Schusses (Strahl,Punkte,Linien)
    Case $type_strahl

    [/autoit] [autoit][/autoit] [autoit]

    line($schuss_array[$i][0],$schuss_array[$i][1],$schuss_array[$i][2],$schuss_array[$i][3],255)
    $schuss_array[$i][6] += $speed
    If $schuss_array[$i][6] >= 20 Then $del_list[$i] = True

    [/autoit] [autoit][/autoit] [autoit]

    Case $type_points

    [/autoit] [autoit][/autoit] [autoit]

    $rate = $schuss_array[$i][4]

    [/autoit] [autoit][/autoit] [autoit]

    $a = $schuss_array[$i][2] - $schuss_array[$i][0]
    $b = $schuss_array[$i][3] - $schuss_array[$i][1]
    $c = Sqrt($a * $a + $b * $b)

    [/autoit] [autoit][/autoit] [autoit]

    If $schuss_array[$i][6] < 0 Then

    [/autoit] [autoit][/autoit] [autoit]

    For $j = 0 To -$schuss_array[$i][6] Step $rate
    $x = -($a / $c) * ($j / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] ;1 Unit C ^= C/X auf X
    $y = -($b / $c) * ($j / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] ;1 Unit C ^= C/Y auf Y
    punkt($x,$y)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Else

    [/autoit] [autoit][/autoit] [autoit]

    For $j = 0 To -$schuss_array[$i][6] Step -$rate
    $x = -($a / $c) * ($j / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] + $a ;1 Unit C ^= C/X auf X
    $y = -($b / $c) * ($j / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] + $b ;1 Unit C ^= C/Y auf Y
    punkt($x,$y)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $schuss_array[$i][6] -= $speed
    If $schuss_array[$i][6] <= -$c * 10 Then $schuss_array[$i][6] = $c * 10
    If Int($schuss_array[$i][6]) = 0 Then $del_list[$i] = True

    [/autoit] [autoit][/autoit] [autoit]

    Case $type_lines

    [/autoit] [autoit][/autoit] [autoit]

    $rate = $schuss_array[$i][4]

    [/autoit] [autoit][/autoit] [autoit]

    $a = $schuss_array[$i][2] - $schuss_array[$i][0]
    $b = $schuss_array[$i][3] - $schuss_array[$i][1]
    $c = Sqrt($a * $a + $b * $b)

    [/autoit] [autoit][/autoit] [autoit]

    If $schuss_array[$i][6] < 0 Then

    [/autoit] [autoit][/autoit] [autoit]

    For $j = 0 To -$schuss_array[$i][6] Step $rate
    $x = -($a / $c) * ($j / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] ;1 Unit C ^= C/X auf X
    $y = -($b / $c) * ($j / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] ;1 Unit C ^= C/Y auf Y
    $x2 = -($a / $c) * (($j + 4) / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] ;1 Unit C ^= C/X auf X
    $y2 = -($b / $c) * (($j + 4) / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] ;1 Unit C ^= C/Y auf Y
    line($x,$y,$x2,$y2,255)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Else

    [/autoit] [autoit][/autoit] [autoit]

    For $j = 0 To -$schuss_array[$i][6] Step -$rate
    $x = -($a / $c) * ($j / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] + $a ;1 Unit C ^= C/X auf X
    $y = -($b / $c) * ($j / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] + $b ;1 Unit C ^= C/Y auf Y
    $x2 = -($a / $c) * (($j + 4) / 10) + ($a / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][0] + $a ;1 Unit C ^= C/X auf X
    $y2 = -($b / $c) * (($j + 4) / 10) + ($b / $c) * -$schuss_array[$i][6] / 10 + $schuss_array[$i][1] + $b ;1 Unit C ^= C/Y auf Y
    line($x,$y,$x2,$y2,255)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $schuss_array[$i][6] -= $speed
    If $schuss_array[$i][6] <= -$c * 10 Then $schuss_array[$i][6] = $c * 10
    If Int($schuss_array[$i][6]) = 0 Then $del_list[$i] = True
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    Local $i = 0

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($schuss_array) Then

    [/autoit] [autoit][/autoit] [autoit]

    Do

    [/autoit] [autoit][/autoit] [autoit]

    If $del_list[$i] Then Schuss_delete($i)

    [/autoit] [autoit][/autoit] [autoit]

    $i += 1

    [/autoit] [autoit][/autoit] [autoit]

    Until $i >= UBound($del_list) - 1

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func particle_add_effect($x, $y, $particle_anzahl, $size, $type)

    [/autoit] [autoit][/autoit] [autoit]

    Local $ubound = UBound($particle_array)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($particle_array) Then
    ReDim $particle_array[$ubound + 1][6]
    Else
    Dim $particle_array[$ubound + 1][6]
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $particle_array[$ubound][0] = $x
    $particle_array[$ubound][1] = $y
    $particle_array[$ubound][2] = $particle_anzahl
    $particle_array[$ubound][3] = $size
    $particle_array[$ubound][4] = $type
    $particle_array[$ubound][5] = 0

    [/autoit] [autoit][/autoit] [autoit]

    Return $ubound

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func particle_delete_effect($num)
    _ArrayDelete($particle_array, $num)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func particle()

    [/autoit] [autoit][/autoit] [autoit]

    Local $x, $y, $x2, $y2, $speed = 0.5, $distance = 2

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($particle_array) - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    Switch $particle_array[$i][4] ; Type/Art des Effektes
    Case $type_spred

    [/autoit] [autoit][/autoit] [autoit]

    For $deg = 0 To 360 Step 360 / $particle_array[$i][2] ; So wird nur die Anzahl an Partikeln gezeichnet

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][0]
    $y = Cos ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    punkt($x,$y)

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    $particle_array[$i][5] += $speed

    [/autoit] [autoit][/autoit] [autoit]

    Case $type_doublespred

    [/autoit] [autoit][/autoit] [autoit]

    For $deg = 0 To 360 Step 360 / $particle_array[$i][2] ; So wird nur die Anzahl an Partikeln gezeichnet

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][0]
    $y = Cos ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    punkt($x,$y)

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][0]
    $y = Cos (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    punkt($x,$y)

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    $particle_array[$i][5] += $speed

    [/autoit] [autoit][/autoit] [autoit]

    Case $type_spred_lines

    [/autoit] [autoit][/autoit] [autoit]

    For $deg = 0 To 360 Step 360 / $particle_array[$i][2] ; So wird nur die Anzahl an Partikeln gezeichnet

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][0]
    $y = Cos ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    $x2 = Sin ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][0]
    $y2 = Cos ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    line($x,$y,$x2,$y2, 255 - ($particle_array[$i][5] / 10) / $particle_array[$i][3] * 255)

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    $particle_array[$i][5] += $speed

    [/autoit] [autoit][/autoit] [autoit]

    Case $type_doublespred_lines

    [/autoit] [autoit][/autoit] [autoit]

    For $deg = 0 To 360 Step 360 / $particle_array[$i][2] ; So wird nur die Anzahl an Partikeln gezeichnet

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][0]
    $y = Cos ($deg * $pi_div_180) * ($particle_array[$i][5]) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    $x2 = Sin ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][0]
    $y2 = Cos ($deg * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    line($x,$y,$x2,$y2, 255 - ($particle_array[$i][5] / 10) / $particle_array[$i][3] * 255)

    [/autoit] [autoit][/autoit] [autoit]

    $x = Sin (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][0]
    $y = Cos (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    $x2 = Sin (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance * 2) / 10 + $particle_array[$i][0]
    $y2 = Cos (($deg + 360 / $particle_array[$i][2] / 2) * $pi_div_180) * ($particle_array[$i][5] - $distance * 2) / 10 + $particle_array[$i][1]

    [/autoit] [autoit][/autoit] [autoit]

    line($x,$y,$x2,$y2, 255 - ($particle_array[$i][5] / 10) / $particle_array[$i][3] * 255)

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    $particle_array[$i][5] += $speed

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit]

    Local $i = 0

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($particle_array) Then

    [/autoit] [autoit][/autoit] [autoit]

    Do

    [/autoit] [autoit][/autoit] [autoit]

    If $particle_array[$i][5] / 10 >= $particle_array[$i][3] Then
    particle_delete_effect($i)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $i += 1

    [/autoit] [autoit][/autoit] [autoit]

    Until $i >= UBound($particle_array) - 1

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func line($x1,$y1,$x2,$y2,$alpha)

    [/autoit] [autoit][/autoit] [autoit]

    glBlendFunc($GL_SRC_ALPHA, $GL_ONE)

    glBegin($GL_LINE_STRIP)
    If $alpha = 255 Then
    glColor3f(0.2, 0.2, 1.0)
    Else
    glColor4f(0.2, 0.2, 1.0, $alpha);Random(0,255,1))
    EndIf
    glVertex2d(-(1 - $feld_scale_x * $x1 - $feld_scale_x / 2), (1 - $feld_scale_y * $y1 - $feld_scale_y / 2))
    glVertex2d(-(1 - $feld_scale_x * $x2 - $feld_scale_x / 2), (1 - $feld_scale_y * $y2 - $feld_scale_y / 2))
    glEnd()

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func punkt($x,$y)

    [/autoit] [autoit][/autoit] [autoit]

    glBegin($GL_POINTS)
    glColor3f(1, 1, 0)
    glVertex2d(-(1 - $feld_scale_x * $x - $feld_scale_x / 2), (1 - $feld_scale_y * $y - $feld_scale_y / 2))
    glEnd()

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Draw_Objekt($objekti, $xi, $yi)

    [/autoit] [autoit][/autoit] [autoit]

    glPushMatrix()
    gltranslatef(-(1 - $feld_scale_x * $xi - $feld_scale_x / 2), (1 - $feld_scale_y * $yi - $feld_scale_y / 2),0)
    ;glRotated($rotation, 0, 0, -1)
    glCallList($objekti)
    glPopMatrix()

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Weg_neuberechnen()

    [/autoit] [autoit][/autoit] [autoit]

    ;For $i = 0 To UBound($weg_punkte) - 1 Step 1

    [/autoit] [autoit][/autoit] [autoit]

    ;If $weg_punkte[$i][0] = $mouse_pos[0] And $weg_punkte[$i][1] = $mouse_pos[1] Then
    ;$weg_punkte_backup = $weg_punkte
    ;$weg_punkte = weg($startpunkt[0], $startpunkt[1], $zielpunkt[0], $zielpunkt[1], $felder_x, $felder_y, $hindernisse, False)

    [/autoit] [autoit][/autoit] [autoit]

    ;If Not IsArray($weg_punkte) Then
    ;$weg_punkte = $weg_punkte_backup
    ;$hindernisse[$mouse_pos[0]][$mouse_pos[1]] = False
    ;EndIf
    ;EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ;Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Mouse_feld_pos()

    [/autoit] [autoit][/autoit] [autoit]

    ;ToolTip("Doing2")

    [/autoit] [autoit][/autoit] [autoit]

    Local $pos[2]

    [/autoit] [autoit][/autoit] [autoit]

    $pos[0] = Int(MouseGetPos(0) / $feld_x)
    $pos[1] = Int(MouseGetPos(1) / $feld_y)

    [/autoit] [autoit][/autoit] [autoit]

    If $pos[0] >= 0 And $pos[1] >= 0 And $pos[0] < $felder_x And $pos[1] < $felder_y Then
    Return $pos
    Else
    SetError(1)
    Return 0
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Punkte_Distance($x1, $y1, $x2, $y2) ;Pythagoras theorem

    [/autoit] [autoit][/autoit] [autoit]

    Local $a, $b, $c

    [/autoit] [autoit][/autoit] [autoit]

    If $x2 = $x1 And $y2 = $y1 Then
    Return 0
    Else
    $a = $y2 - $y1
    $b = $x2 - $x1
    $c = Sqrt($a * $a + $b * $b)
    Return $c
    EndIf
    EndFunc ;==>Pixel_Distance

    [/autoit] [autoit][/autoit] [autoit]

    Func _Mousewheel($hWnd, $msg, $l, $r)

    [/autoit] [autoit][/autoit] [autoit]

    If $l = 0xFF880000 Then
    $ViewPort_x += 20
    $ViewPort_y += 20
    ElseIf $l = 0x00780000 Then
    $ViewPort_x -= 20
    $ViewPort_y -= 20
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_Mousewheel

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinAPI_GetKeyboardState($iFlag = 0)
    Local $aDllRet, $lpKeyState = DllStructCreate("byte[256]")
    $aDllRet = DllCall("User32.dll", "int", "GetKeyboardState", "ptr", DllStructGetPtr($lpKeyState))
    If @error Then Return SetError(@error, 0, 0)
    If $aDllRet[0] = 0 Then
    Return SetError(1, 0, 0)
    Else
    Switch $iFlag
    Case 0
    Local $aReturn[256]
    For $i = 1 To 256
    $aReturn[$i - 1] = DllStructGetData($lpKeyState, 1, $i)
    Next
    Return $aReturn
    Case Else
    Return DllStructGetData($lpKeyState, 1)
    EndSwitch
    EndIf
    EndFunc ;==>_WinAPI_GetKeyboardState

    [/autoit] [autoit][/autoit] [autoit]

    Func _Beenden()

    [/autoit] [autoit][/autoit] [autoit]

    ;DllClose ($dll)

    [/autoit] [autoit][/autoit] [autoit]

    Exit
    EndFunc; ==> beenden und speicher wieder frei geben

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]

    Edit: NEUE BETA VERSION! 01.11.09 :
    autoit.de/wcf/attachment/7134/
    autoit.de/wcf/attachment/7135/

    Veränderungen:
    - Kleines Interface zum updaten und löschen der Gebäude
    - Neue Anzeigen
    - Mehr Texturen
    - Pausen Funktion auf der Pause Taste
    - Und kleine Veränderungen

    Und hier noch nen bild:
    [Blockierte Grafik: http://img229.imageshack.us/img229/9830/bsp2.th.jpg]

  • @moritz1234

    ich habe die opengl udf und die A-Strern udf nicht wo findet man die
    wenn ich das bild sehe sieht es schon ganz gut aus

    gruss Simon

  • Wenn ich dein script starte und das rar archiv entpackt ist dann kommt folgender fehler

    die solltest du noch beheben

  • Zitat

    kennst du kein Tower Defence

    mit Tower defenSe kommts hin^^
    Aber ich spiele lieber in WC3 die TD-Funmaps...werden mittlerweile einige hundert verschiedene sein :thumbup:

  • @morit1243
    habs nciht getestet habe die au3 selbst kompilert und hab keinen fehler bekommen

    meine frage
    was muss man in diesem spiel machen?

    gruss Simon

  • Okey grundsätzlich ist ein ganz normales tower defense, du kannst mit den tasten 1 bit 5 nen Turm auswählen und wenn du mit der Maus dann irgentwohin klickst baust du ihn. Das Ziel ist halt das die Gegner (Die Dreieck) nicht ans Ziel kommen, wofür die Türme sorgen die du bauen kannst. Ich muss jedoch dazu sagen, dass das spiel erst in der beta phase ist, ich mache hinterher noch richtig texturen für die bots ein gelände und und, jedoch muss ich erst rauskrigen wie ich das mit den texturen genau mache.

  • Hi moritz1243

    cool danke
    iwei kommen nach einer bestimmten zeit keine dreiecke mehr
    warum?

    gruss Simon

  • hast du turm 4 gebaut, weil die verlangsamen die gegner und dadurch könnte es zu dem fehler gekommen sein, ich denke ich muss an der funktion für die botbewegung noch arbeiten :S

  • Hi moritz1243

    ok aber eine fehlermeldung kam nicht mit der Exe
    du solltest aber die Fehler im Script beheben
    evtl. geht es ja dann

    Ich habe eine Zeit lang gewartet und es sind keine dreiecke mehr gekommen

    gruss Simon

  • Ja ich weiß wo das Problem liegt und wer es die Tage beheben, aber das dauert noch nen bissel. Außerdem habe ich ne Möglichkeit gefunden Texturen zu benutzen, jetzt sieht das ganze schon viel besser aus. Ich denke ich werde in den nächsten tage nochmal eine verbesserte version uploaden

  • Hi moritz1243

    du könntest ja noch ne anzeige machen wie viele durchgekommen sind un wie viele nicht
    zb. auch wie gut man ist

    ansonsten sieht es schon ganz gut aus

    gruss Simon