Refactor player animation and collision based entrances
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://hop1gedjh8s4" path="res://Assets/Spritesheets/Player/icons_full_32.png" id="4_r8s0p"]
|
||||
[ext_resource type="PackedScene" uid="uid://6athlweutl2g" path="res://Entities/Characters/Player/Individual Components/body.tscn" id="5_6ky6i"]
|
||||
[ext_resource type="Texture2D" uid="uid://crebnygky3qv0" path="res://Assets/Sprites/Black Square.png" id="6_kt7c3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/loading_zone_transporter.tscn" id="6_t8w5b"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/entrance_transporter.tscn" id="6_t8w5b"]
|
||||
[ext_resource type="PackedScene" uid="uid://vc0dkptkr1ow" path="res://Entities/Map Objects/Triggers/on_collision_trigger.tscn" id="7_6p5cp"]
|
||||
[ext_resource type="Texture2D" uid="uid://bf6llktwqhs8l" path="res://Assets/Sprites/Door Fade.png" id="7_7ftpj"]
|
||||
[ext_resource type="PackedScene" uid="uid://ca75b65eh7vv8" path="res://Entities/Map Objects/Loading Zone/collision_loading_zone.tscn" id="9_kp1fr"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fdj0q"]
|
||||
atlas = ExtResource("4_r8s0p")
|
||||
@@ -42,9 +42,8 @@ script = ExtResource("1_83xsp")
|
||||
[node name="Shop Item Notification Connector" type="Node" parent="." unique_id=1088308326]
|
||||
script = ExtResource("2_r8s0p")
|
||||
|
||||
[node name="Spawn Marker Connector" type="Node" parent="." unique_id=2053338893 node_paths=PackedStringArray("player", "markers")]
|
||||
[node name="Spawn Marker Connector" type="Node" parent="." unique_id=2053338893 node_paths=PackedStringArray("markers")]
|
||||
script = ExtResource("3_t8w5b")
|
||||
player = NodePath("../Player Body")
|
||||
markers = NodePath("../Spawn Markers")
|
||||
|
||||
[node name="Tilemap" type="Node2D" parent="." unique_id=81778152]
|
||||
@@ -100,14 +99,13 @@ debug_color = Color(0.9710676, 0.103622, 0.35069537, 0.41960785)
|
||||
|
||||
[node name="Loading Zones" type="Node2D" parent="." unique_id=525992692]
|
||||
|
||||
[node name="Collision Loading Zone" parent="Loading Zones" unique_id=1043800735 node_paths=PackedStringArray("loading_zone_transporter") instance=ExtResource("9_kp1fr")]
|
||||
loading_zone_transporter = NodePath("Loading Zone Transporter")
|
||||
[node name="On Collision Trigger" parent="Loading Zones" unique_id=895298999 instance=ExtResource("7_6p5cp")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Loading Zones/Collision Loading Zone" unique_id=1798970421]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Loading Zones/On Collision Trigger" unique_id=1798970421]
|
||||
position = Vector2(224, 243)
|
||||
shape = SubResource("RectangleShape2D_kp1fr")
|
||||
|
||||
[node name="Loading Zone Transporter" parent="Loading Zones/Collision Loading Zone" unique_id=1690817663 instance=ExtResource("6_t8w5b")]
|
||||
[node name="Loading Zone Transporter" parent="Loading Zones/On Collision Trigger" unique_id=1690817663 instance=ExtResource("6_t8w5b")]
|
||||
destination_marker_name = "Shop Entrance"
|
||||
|
||||
[node name="Spawn Markers" type="Node2D" parent="." unique_id=680471197]
|
||||
@@ -145,3 +143,5 @@ texture = ExtResource("6_kt7c3")
|
||||
position = Vector2(224, 232)
|
||||
scale = Vector2(2, 1)
|
||||
texture = ExtResource("7_7ftpj")
|
||||
|
||||
[connection signal="body_entered" from="Loading Zones/On Collision Trigger" to="Loading Zones/On Collision Trigger/Loading Zone Transporter" method="Activate" unbinds=1]
|
||||
|
||||
@@ -1,10 +1 @@
|
||||
extends Node
|
||||
|
||||
# Public Methods
|
||||
func OnPlayerAreaEntered(area: Area2D) -> void:
|
||||
pass
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
extends Node
|
||||
|
||||
@export var player: CharacterBody2D
|
||||
@export var player_entity: Node2D
|
||||
@export var markers: Node2D
|
||||
|
||||
# Public Methods
|
||||
func _ready() -> void:
|
||||
var body := player_entity.get_node("Player Body") as CharacterBody2D
|
||||
|
||||
var marker_name := MapLoader.GetSpawnMarker()
|
||||
if !marker_name:
|
||||
return
|
||||
@@ -13,4 +15,4 @@ func _ready() -> void:
|
||||
if child.name == marker_name:
|
||||
var marker := child as Marker2D
|
||||
var position := marker.global_position
|
||||
player.position = position
|
||||
body.position = position
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
[ext_resource type="Script" uid="uid://dbscr0b7k3rtp" path="res://Maps/Connectors/Scripts/collision_loading_zone_connector.gd" id="1_18bbf"]
|
||||
[ext_resource type="TileSet" uid="uid://df0lg5vkqwbbt" path="res://Resources/Tilesets/home_interior.tres" id="1_rf04x"]
|
||||
[ext_resource type="Script" uid="uid://dkcsftcdqtmg" path="res://Maps/Connectors/Scripts/spawn_marker_connector.gd" id="2_16uj4"]
|
||||
[ext_resource type="PackedScene" uid="uid://ca75b65eh7vv8" path="res://Entities/Map Objects/Loading Zone/collision_loading_zone.tscn" id="2_fdso5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/loading_zone_transporter.tscn" id="3_7kg22"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/entrance_transporter.tscn" id="3_7kg22"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl2jpjtbiju34" path="res://Maps/Connectors/chest_interaction_connector.tscn" id="3_ec540"]
|
||||
[ext_resource type="PackedScene" uid="uid://b7u4hlvuqiefn" path="res://Entities/Map Objects/Chests/Item Chests/item_chest_02 (Metal).tscn" id="4_a58cd"]
|
||||
[ext_resource type="PackedScene" uid="uid://b60nr4wfvijpf" path="res://Entities/Map Objects/Dialogue/dialogue_trigger.tscn" id="5_msu6a"]
|
||||
[ext_resource type="Texture2D" uid="uid://bm5ewxv51potl" path="res://Assets/Spritesheets/NPCs/Miner_Mike.png" id="6_x3y8m"]
|
||||
[ext_resource type="PackedScene" uid="uid://vc0dkptkr1ow" path="res://Entities/Map Objects/Triggers/on_collision_trigger.tscn" id="7_s4nwa"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqvnkdyhfa1yq" path="res://Maps/Forest Dungeon Entrance/Interiors/Home_01_Overlay_01.png" id="11_6xfm6"]
|
||||
[ext_resource type="PackedScene" uid="uid://c65cfm3t0obwq" path="res://Entities/Characters/Player/player_map_entity.tscn" id="11_s4nwa"]
|
||||
|
||||
@@ -79,13 +79,12 @@ y_sort_enabled = true
|
||||
[node name="Collision Loading Zone Connector" type="Node" parent="Connectors" unique_id=483597596]
|
||||
script = ExtResource("1_18bbf")
|
||||
|
||||
[node name="Spawn Marker Connector" type="Node" parent="Connectors" unique_id=296643918 node_paths=PackedStringArray("player", "markers")]
|
||||
[node name="Spawn Marker Connector" type="Node" parent="Connectors" unique_id=296643918 node_paths=PackedStringArray("player_entity", "markers")]
|
||||
script = ExtResource("2_16uj4")
|
||||
player = NodePath("")
|
||||
player_entity = NodePath("../../Player Map Entity")
|
||||
markers = NodePath("../../Spawn Markers")
|
||||
|
||||
[node name="Chest Interaction Connector" parent="Connectors" unique_id=625804018 node_paths=PackedStringArray("player") instance=ExtResource("3_ec540")]
|
||||
player = NodePath("")
|
||||
[node name="Chest Interaction Connector" parent="Connectors" unique_id=625804018 instance=ExtResource("3_ec540")]
|
||||
|
||||
[node name="Tilemap" type="Node2D" parent="." unique_id=894627186]
|
||||
y_sort_enabled = true
|
||||
@@ -115,16 +114,16 @@ locked_message_dialogue_trigger = NodePath("Locked Dialogue Trigger")
|
||||
[node name="Locked Dialogue Trigger" parent="Objects/Item Chest 02" unique_id=189867444 instance=ExtResource("5_msu6a")]
|
||||
dialogue_name = "MSG_FOREST_DUNGEON_ENTRANCE_HOME_01_LOCKED_CHEST_01"
|
||||
|
||||
[node name="Loading Zones" type="Node2D" parent="." unique_id=1862302491]
|
||||
[node name="Entrances" type="Node2D" parent="." unique_id=1862302491]
|
||||
|
||||
[node name="Collision Loading Zone" parent="Loading Zones" unique_id=1043800735 node_paths=PackedStringArray("loading_zone_transporter") instance=ExtResource("2_fdso5")]
|
||||
loading_zone_transporter = NodePath("Loading Zone Transporter")
|
||||
[node name="On Collision Trigger" parent="Entrances" unique_id=895298999 instance=ExtResource("7_s4nwa")]
|
||||
collision_mask = 16
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Loading Zones/Collision Loading Zone" unique_id=2049955470]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Entrances/On Collision Trigger" unique_id=2049955470]
|
||||
position = Vector2(80, 188)
|
||||
shape = SubResource("RectangleShape2D_7kg22")
|
||||
|
||||
[node name="Loading Zone Transporter" parent="Loading Zones/Collision Loading Zone" unique_id=1690817663 instance=ExtResource("3_7kg22")]
|
||||
[node name="Loading Zone Transporter" parent="Entrances/On Collision Trigger" unique_id=1690817663 instance=ExtResource("3_7kg22")]
|
||||
destination_map_id = 2
|
||||
destination_marker_name = "Home 01 Entrance"
|
||||
|
||||
@@ -166,3 +165,5 @@ position = Vector2(124, 217)
|
||||
scale = Vector2(0.25, 0.25)
|
||||
texture = ExtResource("11_6xfm6")
|
||||
offset = Vector2(16, -436)
|
||||
|
||||
[connection signal="body_entered" from="Entrances/On Collision Trigger" to="Entrances/On Collision Trigger/Loading Zone Transporter" method="Activate" unbinds=1]
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://303hbhqetdhy" path="res://Maps/Connectors/arrow_spawner.tscn" id="2_jtncl"]
|
||||
[ext_resource type="PackedScene" uid="uid://divmfeqf10ri1" path="res://Maps/Connectors/bench_interaction_connector.tscn" id="3_x6da4"]
|
||||
[ext_resource type="Script" uid="uid://kfupww4frb1r" path="res://Maps/Connectors/Scripts/camera_limit_connector.gd" id="3_ycf72"]
|
||||
[ext_resource type="PackedScene" uid="uid://6athlweutl2g" path="res://Entities/Characters/Player/Individual Components/body.tscn" id="4_4igim"]
|
||||
[ext_resource type="PackedScene" uid="uid://b03s7fw8bxdxs" path="res://Maps/Connectors/interactive_loading_zone_connector.tscn" id="4_4lnhp"]
|
||||
[ext_resource type="PackedScene" uid="uid://byp273amg5ji8" path="res://Entities/Map Objects/Chests/Item Chests/item_chest_01 (Wooden).tscn" id="5_bnsbe"]
|
||||
[ext_resource type="Texture2D" uid="uid://bf6llktwqhs8l" path="res://Assets/Sprites/Door Fade.png" id="5_jett5"]
|
||||
@@ -23,12 +22,13 @@
|
||||
[ext_resource type="PackedScene" uid="uid://23tpba4r6ucg" path="res://Entities/Map Objects/Decorative/Outdoor/wooden_bench.tscn" id="14_kgsic"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwbg6wca6yl5j" path="res://Entities/Map Objects/Decorative/Signs/wooden_sign_01.tscn" id="16_dc5v0"]
|
||||
[ext_resource type="PackedScene" uid="uid://c2p8fteeqyikf" path="res://Entities/Characters/Animals/Frog/npc_frog.tscn" id="18_tfw55"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/loading_zone_transporter.tscn" id="19_c5vrl"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/entrance_transporter.tscn" id="19_c5vrl"]
|
||||
[ext_resource type="PackedScene" uid="uid://coaf2ndwb6h61" path="res://Entities/Map Objects/Decorative/Signs/wooden_sign_02.tscn" id="19_jtncl"]
|
||||
[ext_resource type="PackedScene" uid="uid://cla2d3gii8qda" path="res://Entities/Map Objects/Loading Zone/interactive_loading_zone.tscn" id="20_c5vrl"]
|
||||
[ext_resource type="PackedScene" uid="uid://b60nr4wfvijpf" path="res://Entities/Map Objects/Dialogue/dialogue_trigger.tscn" id="20_x6da4"]
|
||||
[ext_resource type="PackedScene" uid="uid://c7rjjlamkqhnw" path="res://Debug/Utility Objects/under_construction_block.tscn" id="26_4lnhp"]
|
||||
[ext_resource type="PackedScene" uid="uid://nbkisxm2oekn" path="res://Entities/Characters/Utility/Components/movement_component.tscn" id="28_mf3dv"]
|
||||
[ext_resource type="PackedScene" uid="uid://c65cfm3t0obwq" path="res://Entities/Characters/Player/player_map_entity.tscn" id="27_0w1de"]
|
||||
[ext_resource type="Script" uid="uid://dtwxia7rlu5xt" path="res://Scripts/Utility/child_node_appender.gd" id="28_mf3dv"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lwurn"]
|
||||
size = Vector2(768, 494)
|
||||
@@ -68,21 +68,16 @@ y_sort_enabled = true
|
||||
|
||||
[node name="Map Connectors" type="Node" parent="." unique_id=1365901208]
|
||||
|
||||
[node name="Chest Interaction Connector" parent="Map Connectors" unique_id=625804018 node_paths=PackedStringArray("player") instance=ExtResource("1_jtncl")]
|
||||
player = NodePath("../../Player")
|
||||
[node name="Chest Interaction Connector" parent="Map Connectors" unique_id=625804018 instance=ExtResource("1_jtncl")]
|
||||
|
||||
[node name="Arrow Spawner" parent="Map Connectors" unique_id=627092886 node_paths=PackedStringArray("player", "arrow_parent") instance=ExtResource("2_jtncl")]
|
||||
player = NodePath("../../Player")
|
||||
arrow_parent = NodePath("../../Objects/Projectiles")
|
||||
[node name="Arrow Spawner" parent="Map Connectors" unique_id=627092886 instance=ExtResource("2_jtncl")]
|
||||
|
||||
[node name="Bench Interaction Connector" parent="Map Connectors" unique_id=541204437 node_paths=PackedStringArray("player") instance=ExtResource("3_x6da4")]
|
||||
player = NodePath("../../Player")
|
||||
[node name="Bench Interaction Connector" parent="Map Connectors" unique_id=541204437 instance=ExtResource("3_x6da4")]
|
||||
|
||||
[node name="Interactive Loading Zone Connector" parent="Map Connectors" unique_id=833475826 node_paths=PackedStringArray("player") instance=ExtResource("4_4lnhp")]
|
||||
player = NodePath("../../Player")
|
||||
[node name="Interactive Loading Zone Connector" parent="Map Connectors" unique_id=833475826 instance=ExtResource("4_4lnhp")]
|
||||
|
||||
[node name="Spawn Marker Connector" parent="Map Connectors" unique_id=807187299 node_paths=PackedStringArray("player", "markers") instance=ExtResource("5_lphfo")]
|
||||
player = NodePath("../../Player")
|
||||
[node name="Spawn Marker Connector" parent="Map Connectors" unique_id=807187299 node_paths=PackedStringArray("player_entity", "markers") instance=ExtResource("5_lphfo")]
|
||||
player_entity = NodePath("../../Player Map Entity")
|
||||
markers = NodePath("../../Spawn Markers")
|
||||
|
||||
[node name="Persistence Connectors" type="Node" parent="." unique_id=1245900932]
|
||||
@@ -97,7 +92,7 @@ gates = Array[NodePath]([NodePath("../../Objects/Spike Gate"), NodePath("../../O
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_ycf72")
|
||||
camera_to_limit = NodePath("../Player/Camera2D")
|
||||
camera_to_limit = NodePath("../Player Map Entity/Child Node Appender/Camera2D")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Camera Limit Connector" unique_id=456404995]
|
||||
position = Vector2(384, 408)
|
||||
@@ -350,13 +345,13 @@ destination_marker_name = "Entrance"
|
||||
[node name="Home 01 Entrance" type="Marker2D" parent="Spawn Markers" unique_id=1662896687]
|
||||
position = Vector2(278, 474)
|
||||
|
||||
[node name="Player" parent="." unique_id=1502234578 instance=ExtResource("4_4igim")]
|
||||
position = Vector2(656, 498)
|
||||
[node name="Player Map Entity" parent="." unique_id=469362016 instance=ExtResource("27_0w1de")]
|
||||
|
||||
[node name="Movement Component" parent="Player" unique_id=737644583 instance=ExtResource("28_mf3dv")]
|
||||
[node name="Child Node Appender" type="Node" parent="Player Map Entity" unique_id=1527392334]
|
||||
script = ExtResource("28_mf3dv")
|
||||
relative_path = "Player Body"
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="Player" unique_id=1115720225]
|
||||
position = Vector2(0, 1)
|
||||
[node name="Camera2D" type="Camera2D" parent="Player Map Entity/Child Node Appender" unique_id=1115720225]
|
||||
zoom = Vector2(3, 3)
|
||||
position_smoothing_enabled = true
|
||||
|
||||
@@ -398,7 +393,6 @@ position = Vector2(760, 312)
|
||||
[node name="Under Construction Block12" parent="Debug" unique_id=1005752992 instance=ExtResource("26_4lnhp")]
|
||||
position = Vector2(760, 328)
|
||||
|
||||
[connection signal="SitOnBenchTriggered" from="Map Connectors/Bench Interaction Connector" to="Player" method="OnSitOnFurnitureTriggered"]
|
||||
[connection signal="TargetHit" from="Objects/ArrowTarget" to="Objects/Spike Gate" method="OpenGate"]
|
||||
[connection signal="TargetHit" from="Objects/ArrowTarget" to="Objects/Spike Gate2" method="OpenGate"]
|
||||
[connection signal="PressurePlateTripped" from="Objects/PressurePlate" to="Objects/Spike Gate" method="OpenGate"]
|
||||
|
||||
Reference in New Issue
Block a user