Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ signal interact_action_changed

@onready var player: Player = self.owner as Player

@onready var dialogue_camera: PhantomCamera2D = %DialogueCamera


func _set_character(new_character: CharacterBody2D) -> void:
character = new_character
Expand Down Expand Up @@ -66,13 +68,15 @@ func _unhandled_input(_event: InputEvent) -> void:
character_sight.monitoring = false
interact_area.interaction_ended.connect(_on_interaction_ended, CONNECT_ONE_SHOT)
interact_area.start_interaction(player, character_sight.is_looking_from_right)
dialogue_camera.priority = 20


func _on_interaction_ended() -> void:
character_sight.monitoring = true
# After interacting, return control to the user.
if character.has_method("return_control"):
character.return_control(self)
dialogue_camera.priority = 0


func _on_character_sight_interact_area_changed() -> void:
Expand Down
20 changes: 20 additions & 0 deletions scenes/game_elements/characters/player/player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
[ext_resource type="Script" uid="uid://necvar42rnih" path="res://scenes/game_elements/props/character_sight/character_sight.gd" id="6_3in67"]
[ext_resource type="Script" uid="uid://e78f8iq448e1" path="res://scenes/game_elements/characters/player/components/animation_player.gd" id="7_0owmy"]
[ext_resource type="AudioStream" uid="uid://cx6jv2cflrmqu" path="res://assets/third_party/sounds/characters/player/Foot.ogg" id="11_blfj0"]
[ext_resource type="Script" uid="uid://bhexx6mj1xv3q" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd" id="11_tnibl"]
[ext_resource type="Texture2D" uid="uid://dxaq5piwxqnht" path="res://scenes/game_elements/characters/player/components/dust.png" id="12_3in67"]
[ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="12_8jhju"]
[ext_resource type="PackedScene" uid="uid://cl06pid826dtg" path="res://scenes/game_elements/characters/player/components/player_repel.tscn" id="12_tnibl"]
[ext_resource type="PackedScene" uid="uid://b3111eergq5yg" path="res://scenes/game_elements/characters/player/components/player_hook.tscn" id="13_ecbbk"]
[ext_resource type="Script" uid="uid://bk52qjv58locq" path="res://scenes/game_logic/light2d_behaviors/artificial_light_behavior.gd" id="16_ecbbk"]
Expand Down Expand Up @@ -71,6 +73,11 @@ height = 42.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_blfj0"]
size = Vector2(110, 80)

[sub_resource type="Resource" id="Resource_5lbww"]
script = ExtResource("12_8jhju")
duration = 0.3
transition = 8

[sub_resource type="Animation" id="Animation_0owmy"]
length = 0.001
tracks/0/type = "value"
Expand Down Expand Up @@ -420,6 +427,19 @@ position = Vector2(47, -30)
shape = SubResource("RectangleShape2D_blfj0")
debug_color = Color(0.600391, 0.54335, 0, 0.42)

[node name="DialogueCamera" type="Node2D" parent="PlayerInteraction" unique_id=1904507612 node_paths=PackedStringArray("follow_target")]
unique_name_in_owner = true
top_level = true
position = Vector2(-184.8, 0)
script = ExtResource("11_tnibl")
follow_mode = 2
follow_target = NodePath("../..")
zoom = Vector2(1.33, 1.33)
tween_resource = SubResource("Resource_5lbww")
follow_offset = Vector2(-184.8, 0)
follow_damping = true
metadata/_custom_type_script = "uid://bhexx6mj1xv3q"

[node name="PlayerRepel" parent="." unique_id=1324972992 instance=ExtResource("12_tnibl")]
unique_name_in_owner = true
position = Vector2(0, -24)
Expand Down
Loading
Loading