Улучшен поиск путей

This commit is contained in:
Евгений Титаренко 2023-08-21 21:27:22 +03:00
parent 3e60215e11
commit 26cc09241f
8 changed files with 107 additions and 18 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=3 uid="uid://cn0rwyjern2vx"]
[gd_scene load_steps=28 format=3 uid="uid://cn0rwyjern2vx"]
[ext_resource type="Script" path="res://scripts/Level.cs" id="1_cxv3e"]
[ext_resource type="TileSet" uid="uid://c7x8hryljgpha" path="res://sprites/tiles/QoL.tres" id="1_kp7y7"]
@ -14,8 +14,8 @@
[ext_resource type="PackedScene" uid="uid://bo5we64scaa1x" path="res://prefabs/furniture/table2.tscn" id="11_43o4k"]
[ext_resource type="PackedScene" uid="uid://cvfk53tse4okx" path="res://prefabs/furniture/book.tscn" id="12_7tfnm"]
[ext_resource type="PackedScene" uid="uid://ccg3n7sobsvdw" path="res://prefabs/enemies/watcher.tscn" id="13_nbkmp"]
[ext_resource type="PackedScene" path="res://prefabs/enemies/living_armor.tscn" id="14_4tmmq"]
[ext_resource type="PackedScene" path="res://prefabs/enemies/wretched.tscn" id="15_3rigu"]
[ext_resource type="PackedScene" uid="uid://bpusphyhhg074" path="res://prefabs/enemies/living_armor.tscn" id="14_4tmmq"]
[ext_resource type="PackedScene" uid="uid://bmyjqerhno5vi" path="res://prefabs/enemies/wretched.tscn" id="15_3rigu"]
[ext_resource type="PackedScene" uid="uid://crulyoxqqw74r" path="res://prefabs/entities/Teleport.tscn" id="16_c6ifr"]
[ext_resource type="PackedScene" uid="uid://dteeck6gict0d" path="res://prefabs/entities/teleport_dest.tscn" id="17_0di6y"]
[ext_resource type="PackedScene" uid="uid://cpi5lgdlnvhlg" path="res://prefabs/enemies/boss/boss.tscn" id="18_8j1w1"]
@ -24,6 +24,31 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kwmx6"]
[sub_resource type="NavigationPolygon" id="NavigationPolygon_ngvpl"]
vertices = PackedVector2Array(312, -944, 192, -944, 40, -984, 96, -984, 320, -816, 200, -816, 48, -888, 56, -888, 40, -760, 56, -760, 440, -584, -120, -584, -120, -720, 312, -888, 440, -1080, 280, -984, 280, -1032, -72, -760, -120, -1080, 224, -1032, 224, -984, 144, -984, 144, -1032, 96, -1032, 192, -888, 176, -888, 176, -944, 56, -944, -8, -984, 200, -760, 176, -760, 176, -816, 56, -816, -72, -888, 440, -376, 440, -168, 168, -168, 168, -296, -232, -376, -408, -296, -408, -856, -232, -720, -120, -856, -80, -816, 320, -760, -72, -944, 40, -816, 48, -944, -8, -1032, 40, -1032)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 5, 6, 7), PackedInt32Array(8, 9, 10, 11, 12), PackedInt32Array(13, 0, 14, 10, 4), PackedInt32Array(14, 0, 15, 16), PackedInt32Array(17, 8, 12), PackedInt32Array(18, 14, 16, 19), PackedInt32Array(19, 20, 21, 22), PackedInt32Array(18, 19, 22), PackedInt32Array(18, 22, 23), PackedInt32Array(1, 24, 25, 26), PackedInt32Array(2, 1, 26), PackedInt32Array(2, 26, 27, 28), PackedInt32Array(5, 29, 30, 31), PackedInt32Array(6, 5, 31), PackedInt32Array(6, 31, 32, 33), PackedInt32Array(34, 35, 36, 37), PackedInt32Array(38, 34, 37, 39), PackedInt32Array(38, 39, 40, 41), PackedInt32Array(17, 12, 41, 40, 42, 43), PackedInt32Array(29, 44, 10), PackedInt32Array(20, 15, 0), PackedInt32Array(33, 43, 42, 18, 45), PackedInt32Array(30, 29, 10), PackedInt32Array(10, 44, 4), PackedInt32Array(24, 13, 4), PackedInt32Array(9, 30, 10), PackedInt32Array(32, 9, 8, 46), PackedInt32Array(33, 32, 46), PackedInt32Array(33, 46, 43), PackedInt32Array(25, 24, 4), PackedInt32Array(7, 25, 4), PackedInt32Array(27, 7, 6, 47), PackedInt32Array(28, 27, 47), PackedInt32Array(28, 47, 45), PackedInt32Array(28, 45, 18, 48), PackedInt32Array(21, 20, 0), PackedInt32Array(49, 48, 18), PackedInt32Array(49, 18, 23), PackedInt32Array(49, 23, 3, 2), PackedInt32Array(0, 3, 21)])
outlines = Array[PackedVector2Array]([PackedVector2Array(168, -168, 440, -168, 440, -376, -232, -376, -232, -720, -120, -720, -120, -584, 440, -584, 440, -1080, -120, -1080, -120, -856, -408, -856, -408, -296, 168, -296), PackedVector2Array(-72, -760, 40, -760, 40, -816, -80, -816), PackedVector2Array(56, -816, 56, -760, 176, -760, 176, -816), PackedVector2Array(200, -760, 320, -760, 320, -816, 200, -816), PackedVector2Array(-72, -888, 48, -888, 48, -944, -72, -944), PackedVector2Array(56, -944, 56, -888, 176, -888, 176, -944), PackedVector2Array(192, -888, 312, -888, 312, -944, 192, -944), PackedVector2Array(-8, -984, 40, -984, 40, -1032, -8, -1032), PackedVector2Array(96, -984, 144, -984, 144, -1032, 96, -1032), PackedVector2Array(224, -1032, 224, -984, 280, -984, 280, -1032)])
[sub_resource type="NavigationPolygon" id="NavigationPolygon_v2a1f"]
vertices = PackedVector2Array(897, -96, 897, 129, 607, 129, 607, -96)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(607, -96, 607, 129, 897, 129, 897, -96)])
[sub_resource type="NavigationPolygon" id="NavigationPolygon_2d3fn"]
vertices = PackedVector2Array(897, -512, 897, -287, 607, -287, 607, -512)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(607, -512, 607, -287, 897, -287, 897, -512)])
[sub_resource type="NavigationPolygon" id="NavigationPolygon_ackae"]
vertices = PackedVector2Array(447, 832, 865, 832, 865, 1153, 447, 1153)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(447, 1153, 865, 1153, 865, 832, 447, 832)])
[sub_resource type="NavigationPolygon" id="NavigationPolygon_wwnnq"]
vertices = PackedVector2Array(-48, -1870, 242, -1870, 242, -1645, -48, -1645)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-48, -1645, 242, -1645, 242, -1870, -48, -1870)])
[node name="level" type="Node2D"]
script = ExtResource("1_cxv3e")
@ -312,7 +337,7 @@ position = Vector2(630, -730)
position = Vector2(322, -381)
[node name="Wretched" parent="." instance=ExtResource("15_3rigu")]
position = Vector2(181, -383)
position = Vector2(216, -381)
[node name="Wretched2" parent="." instance=ExtResource("15_3rigu")]
position = Vector2(-241, -457)
@ -445,6 +470,22 @@ Facing = 2
[node name="And_puzzle_4" parent="." instance=ExtResource("20_1ng7x")]
CountOfButtons = 4
[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."]
navigation_polygon = SubResource("NavigationPolygon_ngvpl")
[node name="NavigationRegion2D2" type="NavigationRegion2D" parent="."]
navigation_polygon = SubResource("NavigationPolygon_v2a1f")
[node name="NavigationRegion2D3" type="NavigationRegion2D" parent="."]
navigation_polygon = SubResource("NavigationPolygon_2d3fn")
[node name="NavigationRegion2D4" type="NavigationRegion2D" parent="."]
navigation_polygon = SubResource("NavigationPolygon_ackae")
[node name="NavigationRegion2D5" type="NavigationRegion2D" parent="."]
position = Vector2(655, 942)
navigation_polygon = SubResource("NavigationPolygon_wwnnq")
[connection signal="ButtonPressed" from="pressure_plate_puzzle_1" to="door_closed_puzzle_1" method="Open"]
[connection signal="ButtonUnpressed" from="pressure_plate_puzzle_1" to="door_closed_puzzle_1" method="Close"]
[connection signal="ButtonPressed" from="pressure_plate_puzzle_2" to="door_closed_puzzle_2" method="Open"]

View file

@ -22,7 +22,7 @@ point_count = 2
[sub_resource type="ShaderMaterial" id="ShaderMaterial_m680d"]
shader = ExtResource("5_64d71")
[sub_resource type="ViewportTexture" id="ViewportTexture_57pph"]
[sub_resource type="ViewportTexture" id="ViewportTexture_kr1ga"]
viewport_path = NodePath("FlashlightViewport")
[sub_resource type="CircleShape2D" id="CircleShape2D_prnh4"]
@ -243,7 +243,7 @@ CameraBounds = Vector2(30, 20)
[node name="PointLight2D" type="PointLight2D" parent="PlayerCamera" node_paths=PackedStringArray("LightViewport")]
blend_mode = 2
range_item_cull_mask = 2
texture = SubResource("ViewportTexture_57pph")
texture = SubResource("ViewportTexture_kr1ga")
script = ExtResource("6_slohe")
LightViewport = NodePath("../../FlashlightViewport")