diff --git a/selection.tscn b/UI/selection/selection.tscn similarity index 100% rename from selection.tscn rename to UI/selection/selection.tscn diff --git a/npc/npc.gd b/npc/npc.gd new file mode 100644 index 0000000..51d4be6 --- /dev/null +++ b/npc/npc.gd @@ -0,0 +1,27 @@ +class_name NPC +extends Node2D + +var id_path: Array[Vector2i] + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + randomize() + $Sprite2D.set_nation(randi()%$Sprite2D.Nations.max) + set_spacesuit(false) + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _physics_process(delta: float) -> void: + if id_path.is_empty(): return + + var target_pos = Vector2(id_path.front()*World.tile_size) + + global_position = global_position.move_toward(target_pos, 1) + + if global_position == target_pos: + id_path.pop_front() + +func set_spacesuit(suit: bool) -> void: + $Sprite2D.set_spacesuit(suit) + diff --git a/npc/npc.tscn b/npc/npc.tscn new file mode 100644 index 0000000..f679a80 --- /dev/null +++ b/npc/npc.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=5 format=3 uid="uid://cxueg5xm4buqk"] + +[ext_resource type="Script" path="res://npc/npc.gd" id="1_m82ir"] +[ext_resource type="Texture2D" uid="uid://bhpnk3olpquth" path="res://assets/moonnauts.png" id="1_vgeae"] +[ext_resource type="Script" path="res://npc/sprite_2d.gd" id="2_jtl2q"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_2v0ml"] +atlas = ExtResource("1_vgeae") +region = Rect2(0, 0, 16, 16) + +[node name="npc" type="Node2D"] +z_index = 32 +z_as_relative = false +script = ExtResource("1_m82ir") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = SubResource("AtlasTexture_2v0ml") +centered = false +script = ExtResource("2_jtl2q") diff --git a/npc/sprite_2d.gd b/npc/sprite_2d.gd new file mode 100644 index 0000000..b456bfe --- /dev/null +++ b/npc/sprite_2d.gd @@ -0,0 +1,27 @@ +extends Sprite2D + +enum Nations { + ru = 0, + arab = 1, + chi = 2, + max, +} + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func set_spacesuit(suit: bool) -> void: + var atlas: AtlasTexture = texture + if suit: atlas.region.position.y = 0 + else: atlas.region.position.y = 16 + + +func set_nation(nation: Nations) -> void: + var atlas: AtlasTexture = texture + atlas.region.position.x = 16*nation diff --git a/project.godot b/project.godot index 72fc3c1..41efb27 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="TestProject" -run/main_scene="res://world.tscn" +run/main_scene="res://world/world.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") config/icon="res://assets/icon.svg" @@ -28,7 +28,7 @@ project/assembly_name="TestProject" [editor_plugins] -enabled=PackedStringArray("res://addons/sprite_painter/plugin.cfg") +enabled=PackedStringArray() [input] diff --git a/world/npcs.gd b/world/npcs.gd new file mode 100644 index 0000000..8117dc5 --- /dev/null +++ b/world/npcs.gd @@ -0,0 +1,33 @@ +extends Node2D + +const NPC_SCENE = preload("res://npc/npc.tscn") + +var npcs: Array[NPC] + + +func add_npc(pos: Vector2i): + var npc: NPC = NPC_SCENE.instantiate() + npc.translate(pos*World.tile_size) + npcs.append(npc) + add_child(npc) + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + add_npc(Vector2i(16, 8)) + add_npc(Vector2i(40, 32)) + set_npc_target(npcs[0], Vector2i(24, 48)) + set_npc_target(npcs[1], Vector2i(24, 49)) + + +func set_npc_target(npc: NPC, target: Vector2i): + var id_path = $"../TileMap".astar_grid.get_id_path( + $"../TileMap/ground".local_to_map(npc.global_position+$"../TileMap/ground".global_position), + target + ).slice(1) + + if not id_path.is_empty(): + npc.id_path = id_path + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/tile_map.gd b/world/tile_map.gd similarity index 89% rename from tile_map.gd rename to world/tile_map.gd index 7b2db08..0329a0f 100644 --- a/tile_map.gd +++ b/world/tile_map.gd @@ -1,3 +1,4 @@ +class_name MyTileMap extends Node2D enum StructType { @@ -71,6 +72,7 @@ enum struct_fields { var layers: Array[TileMapLayer] var layers_dict: Dictionary +var astar_grid: AStarGrid2D func _list_childrens(node: Node2D): for child in node.get_children(): @@ -84,6 +86,18 @@ func _list_childrens(node: Node2D): func _ready() -> void: layers = [] _list_childrens(self) + astar_grid = AStarGrid2D.new() + astar_grid.region = layers_dict["ground"].get_used_rect() + astar_grid.cell_size = Vector2i(16, 16) + astar_grid.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_NEVER + astar_grid.update() + + for x in $ground.get_used_rect().size.x: + for y in $ground.get_used_rect().size.y: + var tile_pos = Vector2i(x,y) + astar_grid.set_point_solid(tile_pos, not is_walkable(tile_pos)) + + func get_maxZ(tile_pos: Vector2i) -> int: var max_z: int = -1024 @@ -148,19 +162,6 @@ func place_way(pos1: Vector2i, pos2: Vector2i) -> bool: place_struct(Vector2i(pos1.x, y), StructType.V_WAY) return true -func remove_struct(pos: Vector2i): - for layer in layers: - var tiledata: TileData = layer.get_cell_tile_data(pos) - if tiledata != null and tiledata.get_custom_data("is_center"): - var struct_size = tiledata.get_custom_data("struct_size") - var half_size = Vector2i(struct_size.x / 2, struct_size.y / 2) - for x in range(struct_size.x): - for y in range(struct_size.y): - var offset = Vector2i(x, y) - var tile_pos = pos+offset-half_size - layer.erase_cell(tile_pos) - return - func destroy_building(pos: Vector2i, only_ways: bool = false): for layer in layers: var tiledata: TileData = layer.get_cell_tile_data(pos) @@ -183,6 +184,20 @@ func destroy_building(pos: Vector2i, only_ways: bool = false): remove_struct(pos) return +func remove_struct(pos: Vector2i): + for layer in layers: + var tiledata: TileData = layer.get_cell_tile_data(pos) + if tiledata != null and tiledata.get_custom_data("is_center"): + var struct_size = tiledata.get_custom_data("struct_size") + var half_size = Vector2i(struct_size.x / 2, struct_size.y / 2) + for x in range(struct_size.x): + for y in range(struct_size.y): + var offset = Vector2i(x, y) + var tile_pos = pos+offset-half_size + layer.erase_cell(tile_pos) + astar_grid.set_point_solid(tile_pos, not is_walkable(tile_pos)) + return + func place_struct(pos: Vector2i, type: StructType) -> bool: if not structs.has(type): return false @@ -206,4 +221,14 @@ func place_struct(pos: Vector2i, type: StructType) -> bool: var offset = Vector2i(x, y) var tile_pos = pos+offset-half_size layer.set_cell(tile_pos, source_id, Vector2i(x,y)+pos_atlas) + astar_grid.set_point_solid(tile_pos, not is_walkable(tile_pos)) return true + +func is_walkable(pos: Vector2i) -> bool: + var state: bool = true + for layer in layers: + var tiledata: TileData = layer.get_cell_tile_data(pos) + if tiledata != null and not tiledata.get_custom_data("walkable"): + state = false + break + return state diff --git a/world.gd b/world/world.gd similarity index 95% rename from world.gd rename to world/world.gd index f19b91a..031d001 100644 --- a/world.gd +++ b/world/world.gd @@ -1,10 +1,13 @@ +class_name World extends Node2D +const tile_size: int = 16 + # Переменная для хранения ссылки на TileMap @onready var ground: TileMapLayer = $TileMap/ground @onready var tileMap: Node2D = $TileMap -const SELECTION_SCENE = preload("res://selection.tscn") +const SELECTION_SCENE = preload("res://UI/selection/selection.tscn") var selected_instrument: instruments var selected_tile: Vector2i @@ -47,6 +50,7 @@ func _physics_process(delta: float) -> void: if(selected_tile==selected_tile2): selected_tile2 = Vector2i(-128,-128) selected2 = false + print(tileMap.is_walkable(selected_tile)) if Input.is_action_just_released("right_mouse") and rmb: selected_tile2 = select_tile(ground.local_to_map(get_global_mouse_position()-tileMap.global_position)) if(selected_tile!=selected_tile2): selected2 = true diff --git a/world.tscn b/world/world.tscn similarity index 98% rename from world.tscn rename to world/world.tscn index f484b28..677d0ac 100644 --- a/world.tscn +++ b/world/world.tscn @@ -1,12 +1,13 @@ -[gd_scene load_steps=8 format=4 uid="uid://d4e2mg6r7kt4m"] +[gd_scene load_steps=9 format=4 uid="uid://d4e2mg6r7kt4m"] -[ext_resource type="Script" path="res://world.gd" id="1_336so"] -[ext_resource type="Texture2D" uid="uid://hksnxmrpo2cp" path="res://assets/tileset.png" id="1_wepw1"] -[ext_resource type="Script" path="res://tile_map.gd" id="2_wnvvd"] -[ext_resource type="Texture2D" uid="uid://ws7nut2tt600" path="res://assets/moonbase.png" id="3_hky6b"] +[ext_resource type="Script" path="res://world/world.gd" id="1_obe6v"] +[ext_resource type="Script" path="res://world/tile_map.gd" id="2_lm4q6"] +[ext_resource type="Texture2D" uid="uid://hksnxmrpo2cp" path="res://assets/tileset.png" id="3_g3o52"] +[ext_resource type="Texture2D" uid="uid://ws7nut2tt600" path="res://assets/moonbase.png" id="4_xeinu"] +[ext_resource type="Script" path="res://world/npcs.gd" id="5_et4gm"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_fyh4j"] -texture = ExtResource("1_wepw1") +texture = ExtResource("3_g3o52") 1:1/0 = 0 0:0/0 = 0 0:0/0/terrain_set = 0 @@ -19,6 +20,7 @@ texture = ExtResource("1_wepw1") 0:0/0/terrains_peering_bit/top_left_corner = 0 0:0/0/terrains_peering_bit/top_side = 0 0:0/0/terrains_peering_bit/top_right_corner = 0 +0:0/0/custom_data_4 = true 0:1/0 = 0 1:0/0 = 0 0:8/0 = 0 @@ -345,6 +347,7 @@ texture = ExtResource("1_wepw1") 0:3/0/terrains_peering_bit/right_side = 2 0:3/0/terrains_peering_bit/bottom_right_corner = 2 0:3/0/terrains_peering_bit/bottom_side = 2 +0:3/0/custom_data_4 = true 0:4/0 = 0 0:4/0/terrain_set = 0 0:4/0/terrain = 2 @@ -353,16 +356,19 @@ texture = ExtResource("1_wepw1") 0:4/0/terrains_peering_bit/bottom_side = 2 0:4/0/terrains_peering_bit/top_side = 2 0:4/0/terrains_peering_bit/top_right_corner = 2 +0:4/0/custom_data_4 = true 0:5/0 = 0 0:5/0/terrain_set = 0 0:5/0/terrain = 2 0:5/0/terrains_peering_bit/right_side = 2 0:5/0/terrains_peering_bit/top_side = 2 0:5/0/terrains_peering_bit/top_right_corner = 2 +0:5/0/custom_data_4 = true 0:6/0 = 0 0:6/0/terrain_set = 0 0:6/0/terrain = 2 0:6/0/terrains_peering_bit/right_side = 2 +0:6/0/custom_data_4 = true 1:3/0 = 0 1:3/0/terrain_set = 0 1:3/0/terrain = 2 @@ -371,6 +377,7 @@ texture = ExtResource("1_wepw1") 1:3/0/terrains_peering_bit/bottom_side = 2 1:3/0/terrains_peering_bit/bottom_left_corner = 2 1:3/0/terrains_peering_bit/left_side = 2 +1:3/0/custom_data_4 = true 1:4/0 = 0 1:4/0/terrain_set = 0 1:4/0/terrain = 2 @@ -382,6 +389,7 @@ texture = ExtResource("1_wepw1") 1:4/0/terrains_peering_bit/top_left_corner = 2 1:4/0/terrains_peering_bit/top_side = 2 1:4/0/terrains_peering_bit/top_right_corner = 2 +1:4/0/custom_data_4 = true 1:5/0 = 0 1:5/0/terrain_set = 0 1:5/0/terrain = 2 @@ -390,17 +398,20 @@ texture = ExtResource("1_wepw1") 1:5/0/terrains_peering_bit/top_left_corner = 2 1:5/0/terrains_peering_bit/top_side = 2 1:5/0/terrains_peering_bit/top_right_corner = 2 +1:5/0/custom_data_4 = true 1:6/0 = 0 1:6/0/terrain_set = 0 1:6/0/terrain = 2 1:6/0/terrains_peering_bit/right_side = 2 1:6/0/terrains_peering_bit/left_side = 2 +1:6/0/custom_data_4 = true 2:3/0 = 0 2:3/0/terrain_set = 0 2:3/0/terrain = 2 2:3/0/terrains_peering_bit/bottom_side = 2 2:3/0/terrains_peering_bit/bottom_left_corner = 2 2:3/0/terrains_peering_bit/left_side = 2 +2:3/0/custom_data_4 = true 2:4/0 = 0 2:4/0/terrain_set = 0 2:4/0/terrain = 2 @@ -409,37 +420,45 @@ texture = ExtResource("1_wepw1") 2:4/0/terrains_peering_bit/left_side = 2 2:4/0/terrains_peering_bit/top_left_corner = 2 2:4/0/terrains_peering_bit/top_side = 2 +2:4/0/custom_data_4 = true 2:5/0 = 0 2:5/0/terrain_set = 0 2:5/0/terrain = 2 2:5/0/terrains_peering_bit/left_side = 2 2:5/0/terrains_peering_bit/top_left_corner = 2 2:5/0/terrains_peering_bit/top_side = 2 +2:5/0/custom_data_4 = true 2:6/0 = 0 2:6/0/terrain_set = 0 2:6/0/terrain = 2 2:6/0/terrains_peering_bit/left_side = 2 +2:6/0/custom_data_4 = true 3:3/0 = 0 3:3/0/terrain_set = 0 3:3/0/terrain = 2 3:3/0/terrains_peering_bit/bottom_side = 2 +3:3/0/custom_data_4 = true 3:4/0 = 0 3:4/0/terrain_set = 0 3:4/0/terrain = 2 3:4/0/terrains_peering_bit/bottom_side = 2 3:4/0/terrains_peering_bit/top_side = 2 +3:4/0/custom_data_4 = true 3:5/0 = 0 3:5/0/terrain_set = 0 3:5/0/terrain = 2 3:5/0/terrains_peering_bit/top_side = 2 +3:5/0/custom_data_4 = true 3:6/0 = 0 3:6/0/terrain_set = 0 3:6/0/terrain = 2 +3:6/0/custom_data_4 = true 4:3/0 = 0 4:3/0/terrain_set = 0 4:3/0/terrain = 2 4:3/0/terrains_peering_bit/right_side = 2 4:3/0/terrains_peering_bit/bottom_side = 2 +4:3/0/custom_data_4 = true 4:4/0 = 0 4:4/0/terrain_set = 0 4:4/0/terrain = 2 @@ -447,6 +466,7 @@ texture = ExtResource("1_wepw1") 4:4/0/terrains_peering_bit/bottom_side = 2 4:4/0/terrains_peering_bit/top_side = 2 4:4/0/terrains_peering_bit/top_right_corner = 2 +4:4/0/custom_data_4 = true 4:5/0 = 0 4:5/0/terrain_set = 0 4:5/0/terrain = 2 @@ -454,11 +474,13 @@ texture = ExtResource("1_wepw1") 4:5/0/terrains_peering_bit/bottom_right_corner = 2 4:5/0/terrains_peering_bit/bottom_side = 2 4:5/0/terrains_peering_bit/top_side = 2 +4:5/0/custom_data_4 = true 4:6/0 = 0 4:6/0/terrain_set = 0 4:6/0/terrain = 2 4:6/0/terrains_peering_bit/right_side = 2 4:6/0/terrains_peering_bit/top_side = 2 +4:6/0/custom_data_4 = true 5:3/0 = 0 5:3/0/terrain_set = 0 5:3/0/terrain = 2 @@ -466,6 +488,7 @@ texture = ExtResource("1_wepw1") 5:3/0/terrains_peering_bit/bottom_side = 2 5:3/0/terrains_peering_bit/bottom_left_corner = 2 5:3/0/terrains_peering_bit/left_side = 2 +5:3/0/custom_data_4 = true 5:4/0 = 0 5:4/0/terrain_set = 0 5:4/0/terrain = 2 @@ -476,6 +499,7 @@ texture = ExtResource("1_wepw1") 5:4/0/terrains_peering_bit/top_left_corner = 2 5:4/0/terrains_peering_bit/top_side = 2 5:4/0/terrains_peering_bit/top_right_corner = 2 +5:4/0/custom_data_4 = true 5:5/0 = 0 5:5/0/terrain_set = 0 5:5/0/terrain = 2 @@ -486,6 +510,7 @@ texture = ExtResource("1_wepw1") 5:5/0/terrains_peering_bit/left_side = 2 5:5/0/terrains_peering_bit/top_left_corner = 2 5:5/0/terrains_peering_bit/top_side = 2 +5:5/0/custom_data_4 = true 5:6/0 = 0 5:6/0/terrain_set = 0 5:6/0/terrain = 2 @@ -493,6 +518,7 @@ texture = ExtResource("1_wepw1") 5:6/0/terrains_peering_bit/left_side = 2 5:6/0/terrains_peering_bit/top_left_corner = 2 5:6/0/terrains_peering_bit/top_side = 2 +5:6/0/custom_data_4 = true 6:3/0 = 0 6:3/0/terrain_set = 0 6:3/0/terrain = 2 @@ -500,6 +526,7 @@ texture = ExtResource("1_wepw1") 6:3/0/terrains_peering_bit/bottom_right_corner = 2 6:3/0/terrains_peering_bit/bottom_side = 2 6:3/0/terrains_peering_bit/left_side = 2 +6:3/0/custom_data_4 = true 6:4/0 = 0 6:4/0/terrain_set = 0 6:4/0/terrain = 2 @@ -510,6 +537,7 @@ texture = ExtResource("1_wepw1") 6:4/0/terrains_peering_bit/top_left_corner = 2 6:4/0/terrains_peering_bit/top_side = 2 6:4/0/terrains_peering_bit/top_right_corner = 2 +6:4/0/custom_data_4 = true 6:5/0 = 0 6:5/0/terrain_set = 0 6:5/0/terrain = 2 @@ -520,6 +548,7 @@ texture = ExtResource("1_wepw1") 6:5/0/terrains_peering_bit/left_side = 2 6:5/0/terrains_peering_bit/top_side = 2 6:5/0/terrains_peering_bit/top_right_corner = 2 +6:5/0/custom_data_4 = true 6:6/0 = 0 6:6/0/terrain_set = 0 6:6/0/terrain = 2 @@ -527,11 +556,13 @@ texture = ExtResource("1_wepw1") 6:6/0/terrains_peering_bit/left_side = 2 6:6/0/terrains_peering_bit/top_side = 2 6:6/0/terrains_peering_bit/top_right_corner = 2 +6:6/0/custom_data_4 = true 7:3/0 = 0 7:3/0/terrain_set = 0 7:3/0/terrain = 2 7:3/0/terrains_peering_bit/bottom_side = 2 7:3/0/terrains_peering_bit/left_side = 2 +7:3/0/custom_data_4 = true 7:4/0 = 0 7:4/0/terrain_set = 0 7:4/0/terrain = 2 @@ -539,6 +570,7 @@ texture = ExtResource("1_wepw1") 7:4/0/terrains_peering_bit/left_side = 2 7:4/0/terrains_peering_bit/top_left_corner = 2 7:4/0/terrains_peering_bit/top_side = 2 +7:4/0/custom_data_4 = true 7:5/0 = 0 7:5/0/terrain_set = 0 7:5/0/terrain = 2 @@ -546,17 +578,20 @@ texture = ExtResource("1_wepw1") 7:5/0/terrains_peering_bit/bottom_left_corner = 2 7:5/0/terrains_peering_bit/left_side = 2 7:5/0/terrains_peering_bit/top_side = 2 +7:5/0/custom_data_4 = true 7:6/0 = 0 7:6/0/terrain_set = 0 7:6/0/terrain = 2 7:6/0/terrains_peering_bit/left_side = 2 7:6/0/terrains_peering_bit/top_side = 2 +7:6/0/custom_data_4 = true 8:3/0 = 0 8:3/0/terrain_set = 0 8:3/0/terrain = 2 8:3/0/terrains_peering_bit/right_side = 2 8:3/0/terrains_peering_bit/bottom_side = 2 8:3/0/terrains_peering_bit/left_side = 2 +8:3/0/custom_data_4 = true 8:4/0 = 0 8:4/0/terrain_set = 0 8:4/0/terrain = 2 @@ -566,6 +601,7 @@ texture = ExtResource("1_wepw1") 8:4/0/terrains_peering_bit/top_left_corner = 2 8:4/0/terrains_peering_bit/top_side = 2 8:4/0/terrains_peering_bit/top_right_corner = 2 +8:4/0/custom_data_4 = true 8:5/0 = 0 8:5/0/terrain_set = 0 8:5/0/terrain = 2 @@ -575,12 +611,14 @@ texture = ExtResource("1_wepw1") 8:5/0/terrains_peering_bit/bottom_left_corner = 2 8:5/0/terrains_peering_bit/left_side = 2 8:5/0/terrains_peering_bit/top_side = 2 +8:5/0/custom_data_4 = true 8:6/0 = 0 8:6/0/terrain_set = 0 8:6/0/terrain = 2 8:6/0/terrains_peering_bit/right_side = 2 8:6/0/terrains_peering_bit/left_side = 2 8:6/0/terrains_peering_bit/top_side = 2 +8:6/0/custom_data_4 = true 9:3/0 = 0 9:3/0/terrain_set = 0 9:3/0/terrain = 2 @@ -590,6 +628,7 @@ texture = ExtResource("1_wepw1") 9:3/0/terrains_peering_bit/left_side = 2 9:3/0/terrains_peering_bit/top_left_corner = 2 9:3/0/terrains_peering_bit/top_side = 2 +9:3/0/custom_data_4 = true 9:4/0 = 0 9:4/0/terrain_set = 0 9:4/0/terrain = 2 @@ -599,6 +638,7 @@ texture = ExtResource("1_wepw1") 9:4/0/terrains_peering_bit/left_side = 2 9:4/0/terrains_peering_bit/top_side = 2 9:4/0/terrains_peering_bit/top_right_corner = 2 +9:4/0/custom_data_4 = true 9:5/0 = 0 9:5/0/terrain_set = 0 9:5/0/terrain = 2 @@ -607,6 +647,7 @@ texture = ExtResource("1_wepw1") 9:5/0/terrains_peering_bit/bottom_side = 2 9:5/0/terrains_peering_bit/left_side = 2 9:5/0/terrains_peering_bit/top_side = 2 +9:5/0/custom_data_4 = true 9:6/0 = 0 9:6/0/terrain_set = 0 9:6/0/terrain = 2 @@ -615,6 +656,7 @@ texture = ExtResource("1_wepw1") 9:6/0/terrains_peering_bit/left_side = 2 9:6/0/terrains_peering_bit/top_side = 2 9:6/0/terrains_peering_bit/top_right_corner = 2 +9:6/0/custom_data_4 = true 10:5/0 = 0 10:5/0/terrain_set = 0 10:5/0/terrain = 2 @@ -623,6 +665,7 @@ texture = ExtResource("1_wepw1") 10:5/0/terrains_peering_bit/bottom_left_corner = 2 10:5/0/terrains_peering_bit/left_side = 2 10:5/0/terrains_peering_bit/top_side = 2 +10:5/0/custom_data_4 = true 10:6/0 = 0 10:6/0/terrain_set = 0 10:6/0/terrain = 2 @@ -631,12 +674,14 @@ texture = ExtResource("1_wepw1") 10:6/0/terrains_peering_bit/left_side = 2 10:6/0/terrains_peering_bit/top_left_corner = 2 10:6/0/terrains_peering_bit/top_side = 2 +10:6/0/custom_data_4 = true 4:7/0 = 0 4:7/0/terrain_set = 0 4:7/0/terrain = 2 4:7/0/terrains_peering_bit/right_side = 2 4:7/0/terrains_peering_bit/bottom_side = 2 4:7/0/terrains_peering_bit/top_side = 2 +4:7/0/custom_data_4 = true 5:7/0 = 0 5:7/0/terrain_set = 0 5:7/0/terrain = 2 @@ -646,6 +691,7 @@ texture = ExtResource("1_wepw1") 5:7/0/terrains_peering_bit/left_side = 2 5:7/0/terrains_peering_bit/top_left_corner = 2 5:7/0/terrains_peering_bit/top_side = 2 +5:7/0/custom_data_4 = true 6:7/0 = 0 6:7/0/terrain_set = 0 6:7/0/terrain = 2 @@ -655,12 +701,14 @@ texture = ExtResource("1_wepw1") 6:7/0/terrains_peering_bit/left_side = 2 6:7/0/terrains_peering_bit/top_side = 2 6:7/0/terrains_peering_bit/top_right_corner = 2 +6:7/0/custom_data_4 = true 7:7/0 = 0 7:7/0/terrain_set = 0 7:7/0/terrain = 2 7:7/0/terrains_peering_bit/bottom_side = 2 7:7/0/terrains_peering_bit/left_side = 2 7:7/0/terrains_peering_bit/top_side = 2 +7:7/0/custom_data_4 = true 8:7/0 = 0 8:7/0/terrain_set = 0 8:7/0/terrain = 2 @@ -668,6 +716,7 @@ texture = ExtResource("1_wepw1") 8:7/0/terrains_peering_bit/bottom_side = 2 8:7/0/terrains_peering_bit/left_side = 2 8:7/0/terrains_peering_bit/top_side = 2 +8:7/0/custom_data_4 = true 1:9/0 = 0 1:9/0/terrain_set = 0 1:9/0/terrain = 1 @@ -681,13 +730,14 @@ texture = ExtResource("1_wepw1") 1:9/0/terrains_peering_bit/top_right_corner = 1 [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_mv7cw"] -texture = ExtResource("3_hky6b") +texture = ExtResource("4_xeinu") 0:0/0 = 0 0:0/0/custom_data_3 = Vector2i(1, 1) 1:0/0 = 0 1:0/0/custom_data_3 = Vector2i(1, 1) 2:0/0 = 0 2:0/0/custom_data_3 = Vector2i(0, 1) +2:0/0/custom_data_4 = true 3:0/0 = 0 3:0/0/custom_data_3 = Vector2i(-1, 1) 4:0/0 = 0 @@ -696,32 +746,43 @@ texture = ExtResource("3_hky6b") 0:1/0/custom_data_3 = Vector2i(1, 1) 1:1/0 = 0 1:1/0/custom_data_3 = Vector2i(1, 1) +1:1/0/custom_data_4 = true 2:1/0 = 0 2:1/0/custom_data_3 = Vector2i(0, 1) +2:1/0/custom_data_4 = true 3:1/0 = 0 3:1/0/custom_data_3 = Vector2i(-1, 1) +3:1/0/custom_data_4 = true 4:1/0 = 0 4:1/0/custom_data_3 = Vector2i(-1, 1) 0:2/0 = 0 0:2/0/custom_data_3 = Vector2i(1, 0) +0:2/0/custom_data_4 = true 1:2/0 = 0 1:2/0/custom_data_3 = Vector2i(1, 0) +1:2/0/custom_data_4 = true 2:2/0 = 0 2:2/0/custom_data_0 = true 2:2/0/custom_data_1 = Vector2i(5, 5) 2:2/0/custom_data_2 = "EMPTY_ROOM" +2:2/0/custom_data_4 = true 3:2/0 = 0 3:2/0/custom_data_3 = Vector2i(-1, 0) +3:2/0/custom_data_4 = true 4:2/0 = 0 4:2/0/custom_data_3 = Vector2i(-1, 0) +4:2/0/custom_data_4 = true 0:3/0 = 0 0:3/0/custom_data_3 = Vector2i(1, -1) 1:3/0 = 0 1:3/0/custom_data_3 = Vector2i(1, -1) +1:3/0/custom_data_4 = true 2:3/0 = 0 2:3/0/custom_data_3 = Vector2i(0, -1) +2:3/0/custom_data_4 = true 3:3/0 = 0 3:3/0/custom_data_3 = Vector2i(-1, -1) +3:3/0/custom_data_4 = true 4:3/0 = 0 4:3/0/custom_data_3 = Vector2i(-1, -1) 0:4/0 = 0 @@ -730,6 +791,7 @@ texture = ExtResource("3_hky6b") 1:4/0/custom_data_3 = Vector2i(1, -1) 2:4/0 = 0 2:4/0/custom_data_3 = Vector2i(0, -1) +2:4/0/custom_data_4 = true 3:4/0 = 0 3:4/0/custom_data_3 = Vector2i(-1, -1) 4:4/0 = 0 @@ -738,6 +800,7 @@ texture = ExtResource("3_hky6b") 1:5/0/custom_data_0 = true 1:5/0/custom_data_1 = Vector2i(3, 1) 1:5/0/custom_data_3 = Vector2i(0, 1) +1:5/0/custom_data_4 = true 2:5/0 = 0 2:5/0/custom_data_3 = Vector2i(-1, 1) 3:5/0 = 0 @@ -746,16 +809,19 @@ texture = ExtResource("3_hky6b") 1:6/0/custom_data_0 = true 1:6/0/custom_data_1 = Vector2i(3, 1) 1:6/0/custom_data_2 = "V_WAY" +1:6/0/custom_data_4 = true 2:6/0 = 0 2:6/0/custom_data_3 = Vector2i(-1, 0) 3:6/0 = 0 3:6/0/custom_data_0 = true 3:6/0/custom_data_1 = Vector2i(1, 3) 3:6/0/custom_data_3 = Vector2i(1, 0) +3:6/0/custom_data_4 = true 1:7/0 = 0 1:7/0/custom_data_0 = true 1:7/0/custom_data_1 = Vector2i(3, 1) 1:7/0/custom_data_3 = Vector2i(0, -1) +1:7/0/custom_data_4 = true 2:7/0 = 0 2:7/0/custom_data_3 = Vector2i(-1, -1) 3:7/0 = 0 @@ -772,6 +838,7 @@ texture = ExtResource("3_hky6b") 4:6/0/custom_data_0 = true 4:6/0/custom_data_1 = Vector2i(1, 3) 4:6/0/custom_data_2 = "H_WAY" +4:6/0/custom_data_4 = true 4:5/0 = 0 4:5/0/custom_data_3 = Vector2i(0, 1) 5:5/0 = 0 @@ -780,6 +847,7 @@ texture = ExtResource("3_hky6b") 5:6/0/custom_data_0 = true 5:6/0/custom_data_1 = Vector2i(1, 3) 5:6/0/custom_data_3 = Vector2i(-1, 0) +5:6/0/custom_data_4 = true 5:7/0 = 0 5:7/0/custom_data_3 = Vector2i(-1, -1) @@ -799,15 +867,17 @@ custom_data_layer_2/name = "struct_name" custom_data_layer_2/type = 4 custom_data_layer_3/name = "center_direction" custom_data_layer_3/type = 6 +custom_data_layer_4/name = "walkable" +custom_data_layer_4/type = 1 sources/0 = SubResource("TileSetAtlasSource_fyh4j") sources/1 = SubResource("TileSetAtlasSource_mv7cw") [node name="World" type="Node2D"] -script = ExtResource("1_336so") +script = ExtResource("1_obe6v") metadata/_edit_horizontal_guides_ = [830.0] [node name="TileMap" type="Node2D" parent="."] -script = ExtResource("2_wnvvd") +script = ExtResource("2_lm4q6") [node name="mountians" type="TileMapLayer" parent="TileMap"] z_index = 32 @@ -847,3 +917,6 @@ tile_set = SubResource("TileSet_twrk0") [node name="Camera2D" type="Camera2D" parent="."] anchor_mode = 0 + +[node name="NPCs" type="Node2D" parent="."] +script = ExtResource("5_et4gm")