From 17cedb8bf19313bdbd6ecdae1e0a63f571aacd74 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Sun, 30 Aug 2026 01:17:38 -0500 Subject: [PATCH] Initial commit --- .editorconfig | 4 + entities/lucca/lucca.tscn | 23 ++ entities/lucca/scripts/lucca.gd | 26 +++ entities/lucca/scripts/lucca.gd.uid | 1 + entities/lucca/sprites/lucca.png | 3 + entities/lucca/sprites/lucca.png.import | 40 ++++ .../lucca/sprites/lucca_sprite_frames.tres | 213 +++++++++++++++++ entities/magus/magus.tscn | 20 ++ entities/magus/scripts/magus.gd | 25 ++ entities/magus/scripts/magus.gd.uid | 1 + entities/magus/sprites/magus.png | 3 + entities/magus/sprites/magus.png.import | 40 ++++ .../magus/sprites/magus_sprite_frames.tres | 44 ++++ icon.svg | 3 + icon.svg.import | 43 ++++ player/player.tscn | 20 ++ player/scripts/player.gd | 74 ++++++ player/scripts/player.gd.uid | 1 + project.godot | 86 +++++++ scenes/kitchen/audio/effects/Sink.wav | 3 + scenes/kitchen/audio/effects/Sink.wav.import | 24 ++ scenes/kitchen/images/kitchen.png | 3 + scenes/kitchen/images/kitchen.png.import | 40 ++++ scenes/kitchen/kitchen.tscn | 130 +++++++++++ scenes/kitchen/scripts/east_exit_trigger.gd | 16 ++ .../kitchen/scripts/east_exit_trigger.gd.uid | 1 + scenes/kitchen/scripts/kitchen.gd | 11 + scenes/kitchen/scripts/kitchen.gd.uid | 1 + scenes/kitchen/scripts/sink.gd | 27 +++ scenes/kitchen/scripts/sink.gd.uid | 1 + scenes/kitchen/scripts/south_exit_trigger.gd | 16 ++ .../kitchen/scripts/south_exit_trigger.gd.uid | 1 + scenes/kitchen/scripts/west_exit_trigger.gd | 16 ++ .../kitchen/scripts/west_exit_trigger.gd.uid | 1 + scenes/kitchen_mirror/dialogue/magus.dialogue | 16 ++ .../dialogue/magus.dialogue.import | 16 ++ scenes/kitchen_mirror/kitchen_mirror.tscn | 137 +++++++++++ scenes/kitchen_mirror/scripts/east_exit.gd | 16 ++ .../kitchen_mirror/scripts/east_exit.gd.uid | 1 + .../kitchen_mirror/scripts/kitchen_mirror.gd | 12 + .../scripts/kitchen_mirror.gd.uid | 1 + .../scripts/magus_interaction.gd | 25 ++ .../scripts/magus_interaction.gd.uid | 1 + scenes/kitchen_mirror/scripts/south_exit.gd | 16 ++ .../kitchen_mirror/scripts/south_exit.gd.uid | 1 + scenes/kitchen_mirror/scripts/west_exit.gd | 16 ++ .../kitchen_mirror/scripts/west_exit.gd.uid | 1 + shared/audio/music/unatco.mp3 | 3 + shared/audio/music/unatco.mp3.import | 19 ++ shared/audio/music/unatco.tscn | 9 + .../fonts/Roboto-VariableFont_wdth,wght.ttf | 3 + .../Roboto-VariableFont_wdth,wght.ttf.import | 36 +++ shared/helpers/baloon.gd | 148 ++++++++++++ shared/helpers/baloon.gd.uid | 1 + shared/helpers/baloon.tscn | 65 ++++++ shared/helpers/baloon/balloon.gd | 218 ++++++++++++++++++ shared/helpers/baloon/balloon.gd.uid | 1 + shared/helpers/baloon/balloon.tscn | 207 +++++++++++++++++ shared/helpers/dialogue_marker.gd | 4 + shared/helpers/dialogue_marker.gd.uid | 1 + shared/helpers/hotspot.gd | 49 ++++ shared/helpers/hotspot.gd.uid | 1 + shared/resources/interaction.tscn | 19 ++ shared/resources/standard_label_settings.tres | 11 + shared/scripts/Global.gd | 13 ++ shared/scripts/Global.gd.uid | 1 + shared/scripts/events.gd | 5 + shared/scripts/events.gd.uid | 1 + 68 files changed, 2035 insertions(+) create mode 100644 .editorconfig create mode 100644 entities/lucca/lucca.tscn create mode 100644 entities/lucca/scripts/lucca.gd create mode 100644 entities/lucca/scripts/lucca.gd.uid create mode 100644 entities/lucca/sprites/lucca.png create mode 100644 entities/lucca/sprites/lucca.png.import create mode 100644 entities/lucca/sprites/lucca_sprite_frames.tres create mode 100644 entities/magus/magus.tscn create mode 100644 entities/magus/scripts/magus.gd create mode 100644 entities/magus/scripts/magus.gd.uid create mode 100644 entities/magus/sprites/magus.png create mode 100644 entities/magus/sprites/magus.png.import create mode 100644 entities/magus/sprites/magus_sprite_frames.tres create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 player/player.tscn create mode 100644 player/scripts/player.gd create mode 100644 player/scripts/player.gd.uid create mode 100644 project.godot create mode 100644 scenes/kitchen/audio/effects/Sink.wav create mode 100644 scenes/kitchen/audio/effects/Sink.wav.import create mode 100644 scenes/kitchen/images/kitchen.png create mode 100644 scenes/kitchen/images/kitchen.png.import create mode 100644 scenes/kitchen/kitchen.tscn create mode 100644 scenes/kitchen/scripts/east_exit_trigger.gd create mode 100644 scenes/kitchen/scripts/east_exit_trigger.gd.uid create mode 100644 scenes/kitchen/scripts/kitchen.gd create mode 100644 scenes/kitchen/scripts/kitchen.gd.uid create mode 100644 scenes/kitchen/scripts/sink.gd create mode 100644 scenes/kitchen/scripts/sink.gd.uid create mode 100644 scenes/kitchen/scripts/south_exit_trigger.gd create mode 100644 scenes/kitchen/scripts/south_exit_trigger.gd.uid create mode 100644 scenes/kitchen/scripts/west_exit_trigger.gd create mode 100644 scenes/kitchen/scripts/west_exit_trigger.gd.uid create mode 100644 scenes/kitchen_mirror/dialogue/magus.dialogue create mode 100644 scenes/kitchen_mirror/dialogue/magus.dialogue.import create mode 100644 scenes/kitchen_mirror/kitchen_mirror.tscn create mode 100644 scenes/kitchen_mirror/scripts/east_exit.gd create mode 100644 scenes/kitchen_mirror/scripts/east_exit.gd.uid create mode 100644 scenes/kitchen_mirror/scripts/kitchen_mirror.gd create mode 100644 scenes/kitchen_mirror/scripts/kitchen_mirror.gd.uid create mode 100644 scenes/kitchen_mirror/scripts/magus_interaction.gd create mode 100644 scenes/kitchen_mirror/scripts/magus_interaction.gd.uid create mode 100644 scenes/kitchen_mirror/scripts/south_exit.gd create mode 100644 scenes/kitchen_mirror/scripts/south_exit.gd.uid create mode 100644 scenes/kitchen_mirror/scripts/west_exit.gd create mode 100644 scenes/kitchen_mirror/scripts/west_exit.gd.uid create mode 100644 shared/audio/music/unatco.mp3 create mode 100644 shared/audio/music/unatco.mp3.import create mode 100644 shared/audio/music/unatco.tscn create mode 100644 shared/fonts/Roboto-VariableFont_wdth,wght.ttf create mode 100644 shared/fonts/Roboto-VariableFont_wdth,wght.ttf.import create mode 100644 shared/helpers/baloon.gd create mode 100644 shared/helpers/baloon.gd.uid create mode 100644 shared/helpers/baloon.tscn create mode 100644 shared/helpers/baloon/balloon.gd create mode 100644 shared/helpers/baloon/balloon.gd.uid create mode 100644 shared/helpers/baloon/balloon.tscn create mode 100644 shared/helpers/dialogue_marker.gd create mode 100644 shared/helpers/dialogue_marker.gd.uid create mode 100644 shared/helpers/hotspot.gd create mode 100644 shared/helpers/hotspot.gd.uid create mode 100644 shared/resources/interaction.tscn create mode 100644 shared/resources/standard_label_settings.tres create mode 100644 shared/scripts/Global.gd create mode 100644 shared/scripts/Global.gd.uid create mode 100644 shared/scripts/events.gd create mode 100644 shared/scripts/events.gd.uid diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/entities/lucca/lucca.tscn b/entities/lucca/lucca.tscn new file mode 100644 index 0000000..1eaea25 --- /dev/null +++ b/entities/lucca/lucca.tscn @@ -0,0 +1,23 @@ +[gd_scene format=3 uid="uid://d3vp4xma2cse0"] + +[ext_resource type="Script" uid="uid://dodiyff5iaog0" path="res://entities/lucca/scripts/lucca.gd" id="1_whafu"] +[ext_resource type="SpriteFrames" uid="uid://blbpxj72vsx6m" path="res://entities/lucca/sprites/lucca_sprite_frames.tres" id="1_xt5e8"] +[ext_resource type="Script" uid="uid://bp4pd1ek1cqnn" path="res://shared/helpers/dialogue_marker.gd" id="2_whafu"] + +[node name="Lucca" type="Node2D" unique_id=415668403] +texture_filter = 1 +scale = Vector2(5, 5) +script = ExtResource("1_whafu") + +[node name="Sprite" type="AnimatedSprite2D" parent="." unique_id=1127738335] +sprite_frames = ExtResource("1_xt5e8") +animation = &"stand_south" +autoplay = "stand_south" +offset = Vector2(0, -16) + +[node name="DialogueMarker" type="Marker2D" parent="." unique_id=1371164534] +position = Vector2(0, -34.399998) +script = ExtResource("2_whafu") +color = Color(0.9607843, 0, 0, 1) +character_name = "Jimmy" +metadata/_custom_type_script = "uid://bp4pd1ek1cqnn" diff --git a/entities/lucca/scripts/lucca.gd b/entities/lucca/scripts/lucca.gd new file mode 100644 index 0000000..67d337a --- /dev/null +++ b/entities/lucca/scripts/lucca.gd @@ -0,0 +1,26 @@ +extends Node2D + + + +func _ready() -> void: + Events.character_started_talking.connect(_on_character_started_talking) + Events.character_finished_talking.connect(_on_character_finished_talking) + +func play_animation(name, flip): + $Sprite.flip_h = flip; + $Sprite.play(name) + +#region Signals + + +func _on_character_started_talking(character_name: String) -> void: + if character_name == "Jimmy": + $Sprite.play("talk") + + +func _on_character_finished_talking(character_name: String) -> void: + if character_name == "Jimmy": + $Sprite.play("stand_south") + + +#endregion diff --git a/entities/lucca/scripts/lucca.gd.uid b/entities/lucca/scripts/lucca.gd.uid new file mode 100644 index 0000000..b0c71c5 --- /dev/null +++ b/entities/lucca/scripts/lucca.gd.uid @@ -0,0 +1 @@ +uid://dodiyff5iaog0 diff --git a/entities/lucca/sprites/lucca.png b/entities/lucca/sprites/lucca.png new file mode 100644 index 0000000..aa9997b --- /dev/null +++ b/entities/lucca/sprites/lucca.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f156e4b1b3457abc86d155af586e1a4c6c9293e53db1b4eaaaf721d34937fae +size 96130 diff --git a/entities/lucca/sprites/lucca.png.import b/entities/lucca/sprites/lucca.png.import new file mode 100644 index 0000000..4d15f3c --- /dev/null +++ b/entities/lucca/sprites/lucca.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://x5wa821apb8d" +path="res://.godot/imported/lucca.png-226d9bc4a9549d17b5c311fe0c8e0a5a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entities/lucca/sprites/lucca.png" +dest_files=["res://.godot/imported/lucca.png-226d9bc4a9549d17b5c311fe0c8e0a5a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entities/lucca/sprites/lucca_sprite_frames.tres b/entities/lucca/sprites/lucca_sprite_frames.tres new file mode 100644 index 0000000..26532c6 --- /dev/null +++ b/entities/lucca/sprites/lucca_sprite_frames.tres @@ -0,0 +1,213 @@ +[gd_resource type="SpriteFrames" format=3 uid="uid://blbpxj72vsx6m"] + +[ext_resource type="Texture2D" uid="uid://x5wa821apb8d" path="res://entities/lucca/sprites/lucca.png" id="1_2irlu"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_lf0m3"] +atlas = ExtResource("1_2irlu") +region = Rect2(142, 300, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_76fy0"] +atlas = ExtResource("1_2irlu") +region = Rect2(163, 300, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y01u6"] +atlas = ExtResource("1_2irlu") +region = Rect2(63, 89, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xt5e8"] +atlas = ExtResource("1_2irlu") +region = Rect2(63, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_whafu"] +atlas = ExtResource("1_2irlu") +region = Rect2(63, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_64way"] +atlas = ExtResource("1_2irlu") +region = Rect2(93, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yagq6"] +atlas = ExtResource("1_2irlu") +region = Rect2(112, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y3616"] +atlas = ExtResource("1_2irlu") +region = Rect2(131, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_p0yg2"] +atlas = ExtResource("1_2irlu") +region = Rect2(150, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bg6hq"] +atlas = ExtResource("1_2irlu") +region = Rect2(169, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qjfl3"] +atlas = ExtResource("1_2irlu") +region = Rect2(190, 89, 14, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cdemb"] +atlas = ExtResource("1_2irlu") +region = Rect2(92, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w7i82"] +atlas = ExtResource("1_2irlu") +region = Rect2(111, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_m2qxj"] +atlas = ExtResource("1_2irlu") +region = Rect2(130, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7xvav"] +atlas = ExtResource("1_2irlu") +region = Rect2(149, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aakwy"] +atlas = ExtResource("1_2irlu") +region = Rect2(169, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fwkcb"] +atlas = ExtResource("1_2irlu") +region = Rect2(189, 49, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8gyla"] +atlas = ExtResource("1_2irlu") +region = Rect2(92, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fomjn"] +atlas = ExtResource("1_2irlu") +region = Rect2(111, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7st6c"] +atlas = ExtResource("1_2irlu") +region = Rect2(130, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5cf0q"] +atlas = ExtResource("1_2irlu") +region = Rect2(149, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tmwin"] +atlas = ExtResource("1_2irlu") +region = Rect2(169, 6, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_n323n"] +atlas = ExtResource("1_2irlu") +region = Rect2(189, 6, 16, 32) + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_lf0m3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_76fy0") +}], +"loop": 1, +"name": &"drink", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_y01u6") +}], +"loop": 1, +"name": &"stand_east", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_xt5e8") +}], +"loop": 1, +"name": &"stand_north", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_whafu") +}], +"loop": 1, +"name": &"stand_south", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_lf0m3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_76fy0") +}], +"loop": 1, +"name": &"talk", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_64way") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yagq6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y3616") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_p0yg2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bg6hq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qjfl3") +}], +"loop": 1, +"name": &"walk_east", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_cdemb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w7i82") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_m2qxj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7xvav") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_aakwy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fwkcb") +}], +"loop": 1, +"name": &"walk_north", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_8gyla") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fomjn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7st6c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5cf0q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tmwin") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_n323n") +}], +"loop": 1, +"name": &"walk_south", +"speed": 8.0 +}] diff --git a/entities/magus/magus.tscn b/entities/magus/magus.tscn new file mode 100644 index 0000000..64a1451 --- /dev/null +++ b/entities/magus/magus.tscn @@ -0,0 +1,20 @@ +[gd_scene format=3 uid="uid://nt43v1uyni2b"] + +[ext_resource type="Script" uid="uid://bbee4w8xyxiii" path="res://entities/magus/scripts/magus.gd" id="1_0jt1g"] +[ext_resource type="SpriteFrames" uid="uid://dv7ukgk6k5kv" path="res://entities/magus/sprites/magus_sprite_frames.tres" id="1_onv7e"] +[ext_resource type="Script" uid="uid://bp4pd1ek1cqnn" path="res://shared/helpers/dialogue_marker.gd" id="2_0jt1g"] + +[node name="Magus" type="Node2D" unique_id=629939891] +scale = Vector2(5, 5) +script = ExtResource("1_0jt1g") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1954953550] +sprite_frames = ExtResource("1_onv7e") +autoplay = "default" +offset = Vector2(0, -16) + +[node name="DialogueMarker" type="Marker2D" parent="." unique_id=529368210] +position = Vector2(0, -36.8) +script = ExtResource("2_0jt1g") +color = Color(1, 0, 1, 1) +character_name = "Elwood" diff --git a/entities/magus/scripts/magus.gd b/entities/magus/scripts/magus.gd new file mode 100644 index 0000000..222707f --- /dev/null +++ b/entities/magus/scripts/magus.gd @@ -0,0 +1,25 @@ +extends Node2D + + +@onready var animation_player: AnimationPlayer = $AnimationPlayer + + +func _ready() -> void: + Events.character_started_talking.connect(_on_character_started_talking) + Events.character_finished_talking.connect(_on_character_finished_talking) + + +#region Signals + + +func _on_character_started_talking(character_name: String) -> void: + if character_name == "Elwood": + $AnimatedSprite2D.play("talk") + + +func _on_character_finished_talking(character_name: String) -> void: + if character_name == "Elwood": + $AnimatedSprite2D.play("default") + + +#endregion diff --git a/entities/magus/scripts/magus.gd.uid b/entities/magus/scripts/magus.gd.uid new file mode 100644 index 0000000..3b35270 --- /dev/null +++ b/entities/magus/scripts/magus.gd.uid @@ -0,0 +1 @@ +uid://bbee4w8xyxiii diff --git a/entities/magus/sprites/magus.png b/entities/magus/sprites/magus.png new file mode 100644 index 0000000..41ae4cc --- /dev/null +++ b/entities/magus/sprites/magus.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba546a915c33a456ae68ae500c3704d35c64f2340d40c28156592248b115bba9 +size 69570 diff --git a/entities/magus/sprites/magus.png.import b/entities/magus/sprites/magus.png.import new file mode 100644 index 0000000..840d9f8 --- /dev/null +++ b/entities/magus/sprites/magus.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw70qdoiwnhir" +path="res://.godot/imported/magus.png-accec5791145174bb40e684340ba2d42.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entities/magus/sprites/magus.png" +dest_files=["res://.godot/imported/magus.png-accec5791145174bb40e684340ba2d42.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entities/magus/sprites/magus_sprite_frames.tres b/entities/magus/sprites/magus_sprite_frames.tres new file mode 100644 index 0000000..60f9cba --- /dev/null +++ b/entities/magus/sprites/magus_sprite_frames.tres @@ -0,0 +1,44 @@ +[gd_resource type="SpriteFrames" format=3 uid="uid://dv7ukgk6k5kv"] + +[ext_resource type="Texture2D" uid="uid://cw70qdoiwnhir" path="res://entities/magus/sprites/magus.png" id="1_8aab7"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_onv7e"] +atlas = ExtResource("1_8aab7") +region = Rect2(319, 6, 30, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0jt1g"] +atlas = ExtResource("1_8aab7") +region = Rect2(351, 7, 30, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u2jd0"] +atlas = ExtResource("1_8aab7") +region = Rect2(670, 8, 19, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_no6fi"] +atlas = ExtResource("1_8aab7") +region = Rect2(692, 8, 19, 32) + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_onv7e") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0jt1g") +}], +"loop": 1, +"name": &"default", +"speed": 2.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_u2jd0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_no6fi") +}], +"loop": 1, +"name": &"talk", +"speed": 5.0 +}] diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..90ddfb7 --- /dev/null +++ b/icon.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c80384360a5b269d1054bfb27241258154e2cc8167c522016fdc1820e84e0f8 +size 995 diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..b84eb93 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7ng1uin2t658" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/player/player.tscn b/player/player.tscn new file mode 100644 index 0000000..dbb9d21 --- /dev/null +++ b/player/player.tscn @@ -0,0 +1,20 @@ +[gd_scene format=3 uid="uid://cuc5q5cao3vjx"] + +[ext_resource type="PackedScene" uid="uid://d3vp4xma2cse0" path="res://entities/lucca/lucca.tscn" id="1_4flbx"] +[ext_resource type="Script" uid="uid://syr14v0u22s7" path="res://player/scripts/player.gd" id="1_onrkg"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_5t4nn"] +size = Vector2(46, 10) + +[node name="Player" type="CharacterBody2D" unique_id=1952104269] +collision_layer = 32769 +collision_mask = 32769 +script = ExtResource("1_onrkg") + +[node name="Sprite" parent="." unique_id=1658534661 instance=ExtResource("1_4flbx")] +position = Vector2(0, -1) +scale = Vector2(4, 4) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=500589119] +position = Vector2(31, -6) +shape = SubResource("RectangleShape2D_5t4nn") diff --git a/player/scripts/player.gd b/player/scripts/player.gd new file mode 100644 index 0000000..c31e831 --- /dev/null +++ b/player/scripts/player.gd @@ -0,0 +1,74 @@ +extends CharacterBody2D + +# Movement speed in pixels per second +@export var speed: float = 600.0 +var last_direction = Vector2.DOWN + +var animation_playing =false; +var animation_start_time = 0; +var animation_duration = 0; + + + +func _process(delta: float) -> void: + if animation_playing: + var elapsed = (Time.get_ticks_msec() - animation_start_time) + if elapsed > animation_duration: + animation_playing = false + reset_to_stand() + +func _input(event): + if animation_playing==true: + return + + if Input.is_action_just_pressed("move_left"): + $Sprite.play_animation("walk_east", true) + last_direction = Vector2.LEFT + elif Input.is_action_just_pressed("move_right"): + $Sprite.play_animation("walk_east", false) + last_direction = Vector2.RIGHT + elif Input.is_action_just_pressed("move_up"): + $Sprite.play_animation("walk_north", false) + last_direction = Vector2.UP + elif Input.is_action_just_pressed("move_down"): + $Sprite.play_animation("walk_south", false) + last_direction = Vector2.DOWN + + + if not Input.is_action_pressed("move_left") and not Input.is_action_pressed("move_right") and not Input.is_action_pressed("move_up") and not Input.is_action_pressed("move_down"): + reset_to_stand() + + +func _physics_process(_delta: float) -> void: + if animation_playing==true: + return + + + # 1. Get the direction vector based on our Input Map actions + var direction := Input.get_vector("move_left", "move_right", "move_up", "move_down") + + # 2. Apply direction to velocity multiplied by our speed + if direction != Vector2.ZERO: + velocity = direction * speed + else: + # Smoothly slow down to a stop if no keys are pressed + velocity = velocity.move_toward(Vector2.ZERO, speed) + + # 3. Move the character body and handle physical collisions automatically + move_and_slide() + +func play_animation(name:StringName, duration): + animation_playing = true + animation_duration = duration + $Sprite.play_animation(name, false) + animation_start_time = Time.get_ticks_msec() + +func reset_to_stand(): + if last_direction==Vector2.UP: + $Sprite.play_animation("stand_north", false) + elif last_direction==Vector2.DOWN: + $Sprite.play_animation("stand_south", false) + elif last_direction==Vector2.LEFT: + $Sprite.play_animation("stand_east", true) + elif last_direction==Vector2.RIGHT: + $Sprite.play_animation("stand_east", false) diff --git a/player/scripts/player.gd.uid b/player/scripts/player.gd.uid new file mode 100644 index 0000000..00436de --- /dev/null +++ b/player/scripts/player.gd.uid @@ -0,0 +1 @@ +uid://syr14v0u22s7 diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..eeeb380 --- /dev/null +++ b/project.godot @@ -0,0 +1,86 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="adventure" +run/main_scene="uid://ccbwrgaojccam" +config/features=PackedStringArray("4.7", "Mobile") +config/icon="res://icon.svg" + +[autoload] + +Unatco="*uid://ci42q3y8u6ves" +Global="*uid://5qv3gwwiq6hf" +DialogueManager="*uid://c3rodes2l3gxb" +Events="*uid://bam75tp2cvnnv" + +[dialogue_manager] + +runtime/balloon_path="uid://fuap5c0yodp" + +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" + +[editor_plugins] + +enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg") + +[input] + +move_left={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_up={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_down={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +interact={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194310,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} + +[internationalization] + +locale/translations_pot_files=PackedStringArray("res://scenes/kitchen_mirror/dialogue/magus.dialogue") + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +textures/canvas_textures/default_texture_filter=0 +rendering_device/driver.windows="d3d12" +renderer/rendering_method="mobile" diff --git a/scenes/kitchen/audio/effects/Sink.wav b/scenes/kitchen/audio/effects/Sink.wav new file mode 100644 index 0000000..198fade --- /dev/null +++ b/scenes/kitchen/audio/effects/Sink.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e76d441121f1aa9004479cc434926cadf833c859186022b805f831621036752a +size 92858 diff --git a/scenes/kitchen/audio/effects/Sink.wav.import b/scenes/kitchen/audio/effects/Sink.wav.import new file mode 100644 index 0000000..bbaa686 --- /dev/null +++ b/scenes/kitchen/audio/effects/Sink.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cmb2foaqsx4av" +path="res://.godot/imported/Sink.wav-f7668a8793e1ac29fd99ca4ad1763c69.sample" + +[deps] + +source_file="res://scenes/kitchen/audio/effects/Sink.wav" +dest_files=["res://.godot/imported/Sink.wav-f7668a8793e1ac29fd99ca4ad1763c69.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=1 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/scenes/kitchen/images/kitchen.png b/scenes/kitchen/images/kitchen.png new file mode 100644 index 0000000..588c099 --- /dev/null +++ b/scenes/kitchen/images/kitchen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:152590bc02489a4270c48b9d66183e692f22c2d8601d4a4da7c873cba0e18bb2 +size 1912158 diff --git a/scenes/kitchen/images/kitchen.png.import b/scenes/kitchen/images/kitchen.png.import new file mode 100644 index 0000000..f00d978 --- /dev/null +++ b/scenes/kitchen/images/kitchen.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dyjimwqh6nf3b" +path="res://.godot/imported/kitchen.png-1c4be3f0f06244b5bfca89413b3ff655.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/kitchen/images/kitchen.png" +dest_files=["res://.godot/imported/kitchen.png-1c4be3f0f06244b5bfca89413b3ff655.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/kitchen/kitchen.tscn b/scenes/kitchen/kitchen.tscn new file mode 100644 index 0000000..f6f4aea --- /dev/null +++ b/scenes/kitchen/kitchen.tscn @@ -0,0 +1,130 @@ +[gd_scene format=3 uid="uid://ccbwrgaojccam"] + +[ext_resource type="Script" uid="uid://cyebbcwew3oq5" path="res://scenes/kitchen/scripts/kitchen.gd" id="1_hwcho"] +[ext_resource type="Script" uid="uid://77kbxobqvmqp" path="res://scenes/kitchen/scripts/west_exit_trigger.gd" id="1_yi3jr"] +[ext_resource type="Script" uid="uid://cvx3b5jt4dluc" path="res://scenes/kitchen/scripts/sink.gd" id="4_8xxd6"] +[ext_resource type="LabelSettings" uid="uid://dkpp84p885g8h" path="res://shared/resources/standard_label_settings.tres" id="4_hwcho"] +[ext_resource type="Script" uid="uid://b7u48u6urn7pt" path="res://scenes/kitchen/scripts/east_exit_trigger.gd" id="5_hwcho"] +[ext_resource type="PackedScene" uid="uid://cuc5q5cao3vjx" path="res://player/player.tscn" id="5_lmija"] +[ext_resource type="Texture2D" uid="uid://dyjimwqh6nf3b" path="res://scenes/kitchen/images/kitchen.png" id="5_yi3jr"] +[ext_resource type="AudioStream" uid="uid://cmb2foaqsx4av" path="res://scenes/kitchen/audio/effects/Sink.wav" id="6_a4owj"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_5t4nn"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_4nnu7"] +size = Vector2(2002, 28.5) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_5t4nn"] +size = Vector2(40.5, 310.5) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_d67dk"] +size = Vector2(17.5, 309) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_y2vya"] +size = Vector2(98, 285.5) + +[node name="Node2D" type="Node2D" unique_id=396398678] +y_sort_enabled = true +script = ExtResource("1_hwcho") + +[node name="Movement Collision" type="StaticBody2D" parent="." unique_id=352975622] +position = Vector2(130, 164) +physics_material_override = SubResource("PhysicsMaterial_5t4nn") + +[node name="Everything else" type="CollisionPolygon2D" parent="Movement Collision" unique_id=1786835918] +position = Vector2(-2, 3) +polygon = PackedVector2Array(-139, 616, 37, 670, 291, 593, 488, 508, 1351, 615, 1353, 928, 1822, 926, 1806, 51, 456, 21, -169, 30) + +[node name="Island" type="CollisionPolygon2D" parent="Movement Collision" unique_id=506849821] +polygon = PackedVector2Array(359, 784, 717, 864, 782, 807, 912, 824, 1027, 720, 491, 674, 358, 720) + +[node name="Bottom" type="CollisionShape2D" parent="Movement Collision" unique_id=1295111135] +position = Vector2(841, 992) +shape = SubResource("RectangleShape2D_4nnu7") + +[node name="Table" type="CollisionPolygon2D" parent="Movement Collision" unique_id=1468659186] +polygon = PackedVector2Array(-139, 834, 231, 922, 231, 984, -142, 988) + +[node name="West Exit Trigger" type="Area2D" parent="." unique_id=1623086752] +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("1_yi3jr") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="West Exit Trigger" unique_id=926854248] +position = Vector2(-1, 940) +shape = SubResource("RectangleShape2D_5t4nn") + +[node name="East Exit Trigger" type="Area2D" parent="." unique_id=1533846235] +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("5_hwcho") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="East Exit Trigger" unique_id=1119900302] +position = Vector2(1904, 1050) +shape = SubResource("RectangleShape2D_d67dk") + +[node name="Sink" type="Area2D" parent="." unique_id=404554411] +position = Vector2(1461, 569) +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("4_8xxd6") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Sink" unique_id=115520028] +position = Vector2(31, 165) +shape = SubResource("RectangleShape2D_y2vya") + +[node name="Label" type="Label" parent="Sink" unique_id=419035073] +visible = false +offset_left = 36.0 +offset_top = -25.0 +offset_right = 76.0 +offset_bottom = -2.0 +text = "Drink" +label_settings = ExtResource("4_hwcho") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="Sink" unique_id=1873898426] +stream = ExtResource("6_a4owj") + +[node name="Kitchen" type="Sprite2D" parent="." unique_id=1426636203] +texture = ExtResource("5_yi3jr") +centered = false +region_enabled = true +region_rect = Rect2(0, 0, 1920, 1080) + +[node name="Island" type="Sprite2D" parent="." unique_id=1469135755] +y_sort_enabled = true +position = Vector2(418, 987) +texture = ExtResource("5_yi3jr") +centered = false +offset = Vector2(0, -412) +region_enabled = true +region_rect = Rect2(7, 1094, 728, 412) + +[node name="Chair" type="Sprite2D" parent="." unique_id=869791031] +y_sort_enabled = true +position = Vector2(1, 1079) +texture = ExtResource("5_yi3jr") +centered = false +offset = Vector2(0, -322) +region_enabled = true +region_rect = Rect2(860, 1109, 408, 322) + +[node name="Player" parent="." unique_id=1952104269 instance=ExtResource("5_lmija")] +unique_name_in_owner = true +y_sort_enabled = true +position = Vector2(107.00003, 941.00006) +scale = Vector2(3, 3) + +[node name="West Entrance" type="Marker2D" parent="." unique_id=1551250499] +position = Vector2(107, 943) + +[node name="East Entrance" type="Marker2D" parent="." unique_id=2066137134] +position = Vector2(1693, 1122) + +[node name="South Entrance" type="Marker2D" parent="." unique_id=1120897992] +position = Vector2(1109, 1032) + +[connection signal="body_entered" from="West Exit Trigger" to="West Exit Trigger" method="_on_body_entered"] +[connection signal="body_entered" from="East Exit Trigger" to="East Exit Trigger" method="_on_body_entered"] +[connection signal="body_entered" from="Sink" to="Sink" method="_on_body_entered"] +[connection signal="body_exited" from="Sink" to="Sink" method="_on_body_exited"] diff --git a/scenes/kitchen/scripts/east_exit_trigger.gd b/scenes/kitchen/scripts/east_exit_trigger.gd new file mode 100644 index 0000000..1934a74 --- /dev/null +++ b/scenes/kitchen/scripts/east_exit_trigger.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "West Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen_mirror/kitchen_mirror.tscn") diff --git a/scenes/kitchen/scripts/east_exit_trigger.gd.uid b/scenes/kitchen/scripts/east_exit_trigger.gd.uid new file mode 100644 index 0000000..821194c --- /dev/null +++ b/scenes/kitchen/scripts/east_exit_trigger.gd.uid @@ -0,0 +1 @@ +uid://b7u48u6urn7pt diff --git a/scenes/kitchen/scripts/kitchen.gd b/scenes/kitchen/scripts/kitchen.gd new file mode 100644 index 0000000..43370ef --- /dev/null +++ b/scenes/kitchen/scripts/kitchen.gd @@ -0,0 +1,11 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + if Global.player_entrance_name: + $Player.global_position = get_node(Global.player_entrance_name).global_position + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/scenes/kitchen/scripts/kitchen.gd.uid b/scenes/kitchen/scripts/kitchen.gd.uid new file mode 100644 index 0000000..1c4dd22 --- /dev/null +++ b/scenes/kitchen/scripts/kitchen.gd.uid @@ -0,0 +1 @@ +uid://cyebbcwew3oq5 diff --git a/scenes/kitchen/scripts/sink.gd b/scenes/kitchen/scripts/sink.gd new file mode 100644 index 0000000..18f7da6 --- /dev/null +++ b/scenes/kitchen/scripts/sink.gd @@ -0,0 +1,27 @@ +extends Area2D + +var inside = false +# 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 _input(event): + if inside and Input.is_action_just_pressed("interact"): + $AudioStreamPlayer2D.play() + + %Player.play_animation("drink",2100) + + +func _on_body_entered(body: Node2D) -> void: + $Label.visible = true + inside = true + + +func _on_body_exited(body: Node2D) -> void: + $Label.visible = false + inside = true diff --git a/scenes/kitchen/scripts/sink.gd.uid b/scenes/kitchen/scripts/sink.gd.uid new file mode 100644 index 0000000..dbb180a --- /dev/null +++ b/scenes/kitchen/scripts/sink.gd.uid @@ -0,0 +1 @@ +uid://cvx3b5jt4dluc diff --git a/scenes/kitchen/scripts/south_exit_trigger.gd b/scenes/kitchen/scripts/south_exit_trigger.gd new file mode 100644 index 0000000..0b28923 --- /dev/null +++ b/scenes/kitchen/scripts/south_exit_trigger.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "South Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen_mirror/kitchen_mirror.tscn") diff --git a/scenes/kitchen/scripts/south_exit_trigger.gd.uid b/scenes/kitchen/scripts/south_exit_trigger.gd.uid new file mode 100644 index 0000000..b6e6164 --- /dev/null +++ b/scenes/kitchen/scripts/south_exit_trigger.gd.uid @@ -0,0 +1 @@ +uid://bhc2174723t3m diff --git a/scenes/kitchen/scripts/west_exit_trigger.gd b/scenes/kitchen/scripts/west_exit_trigger.gd new file mode 100644 index 0000000..fb63ed2 --- /dev/null +++ b/scenes/kitchen/scripts/west_exit_trigger.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "East Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen_mirror/kitchen_mirror.tscn") diff --git a/scenes/kitchen/scripts/west_exit_trigger.gd.uid b/scenes/kitchen/scripts/west_exit_trigger.gd.uid new file mode 100644 index 0000000..2e49328 --- /dev/null +++ b/scenes/kitchen/scripts/west_exit_trigger.gd.uid @@ -0,0 +1 @@ +uid://77kbxobqvmqp diff --git a/scenes/kitchen_mirror/dialogue/magus.dialogue b/scenes/kitchen_mirror/dialogue/magus.dialogue new file mode 100644 index 0000000..3b9e04b --- /dev/null +++ b/scenes/kitchen_mirror/dialogue/magus.dialogue @@ -0,0 +1,16 @@ +~ start +Elwood: Alright Jimmy. I need you to pick up some ingredients for the gala tonight. +Jimmy: What do you need? +Elwood: We need 1000 pieces of salt. +Jimmy: El, I don't think that's how to get salt. You pick up bags of various poundage. +Elwood: I'll show you some damn poundage unless you get me my damn salt. + +- Why do I have to get them? + Elwood: Because I said so, dingus! I'm your boss. So get to it! +- Take that list and shove it where the sun don't shine! + Elwood: That's it Jimmy! I'm writing you up! + Jimmy: Not if I write you up first! + Elwood: I'm going to write you up so hard! + Jimmy: I'll write you up even harder! + Elwood: You son of a! +=> END \ No newline at end of file diff --git a/scenes/kitchen_mirror/dialogue/magus.dialogue.import b/scenes/kitchen_mirror/dialogue/magus.dialogue.import new file mode 100644 index 0000000..6381a31 --- /dev/null +++ b/scenes/kitchen_mirror/dialogue/magus.dialogue.import @@ -0,0 +1,16 @@ +[remap] + +importer="dialogue_manager" +importer_version=18 +type="Resource" +uid="uid://dq0rebksvpqsq" +path="res://.godot/imported/magus.dialogue-250d6c867bed30b9f34528cf753a086b.tres" + +[deps] + +source_file="res://scenes/kitchen_mirror/dialogue/magus.dialogue" +dest_files=["res://.godot/imported/magus.dialogue-250d6c867bed30b9f34528cf753a086b.tres"] + +[params] + +defaults=true diff --git a/scenes/kitchen_mirror/kitchen_mirror.tscn b/scenes/kitchen_mirror/kitchen_mirror.tscn new file mode 100644 index 0000000..2ca1ce5 --- /dev/null +++ b/scenes/kitchen_mirror/kitchen_mirror.tscn @@ -0,0 +1,137 @@ +[gd_scene format=3 uid="uid://cdvdgefw2xiim"] + +[ext_resource type="Texture2D" uid="uid://dyjimwqh6nf3b" path="res://scenes/kitchen/images/kitchen.png" id="1_8froy"] +[ext_resource type="Script" uid="uid://d13cdc8w03klw" path="res://scenes/kitchen_mirror/scripts/kitchen_mirror.gd" id="1_d2q7u"] +[ext_resource type="Script" uid="uid://bm1tgx7c8cmbq" path="res://scenes/kitchen_mirror/scripts/west_exit.gd" id="4_8froy"] +[ext_resource type="PackedScene" uid="uid://cuc5q5cao3vjx" path="res://player/player.tscn" id="4_8uwkb"] +[ext_resource type="Script" uid="uid://ddi7n13cestbt" path="res://scenes/kitchen_mirror/scripts/east_exit.gd" id="5_8froy"] +[ext_resource type="PackedScene" uid="uid://nt43v1uyni2b" path="res://entities/magus/magus.tscn" id="6_d2q7u"] +[ext_resource type="LabelSettings" uid="uid://dkpp84p885g8h" path="res://shared/resources/standard_label_settings.tres" id="7_5jiw2"] +[ext_resource type="Script" uid="uid://e22lo1h2ovr7" path="res://shared/helpers/hotspot.gd" id="9_8iblu"] +[ext_resource type="Resource" uid="uid://dq0rebksvpqsq" path="res://scenes/kitchen_mirror/dialogue/magus.dialogue" id="10_mdb7i"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_5t4nn"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_4nnu7"] +size = Vector2(2039, 118) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_5t4nn"] +size = Vector2(8, 321) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_d67dk"] +size = Vector2(15.5, 218.5) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_y2vya"] +size = Vector2(506.00003, 455.91666) + +[node name="Node2D" type="Node2D" unique_id=396398678] +y_sort_enabled = true +script = ExtResource("1_d2q7u") + +[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=352975622] +position = Vector2(92, 176) +physics_material_override = SubResource("PhysicsMaterial_5t4nn") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D" unique_id=1786835918] +position = Vector2(1637, -47) +scale = Vector2(-1, 1) +polygon = PackedVector2Array(-139, 616, 37, 670, 291, 593, 488, 508, 1294, 605, 1295, 965, 1770, 961, 1806, 4, 456, 21, -169, 30) + +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="StaticBody2D" unique_id=506849821] +position = Vector2(1660, 7) +scale = Vector2(-1, 1) +polygon = PackedVector2Array(359, 784, 717, 864, 782, 807, 912, 824, 1027, 720, 477, 627, 358, 720) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=1773577601] +position = Vector2(905.5, 1055) +shape = SubResource("RectangleShape2D_4nnu7") + +[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="StaticBody2D" unique_id=1227676112] +polygon = PackedVector2Array(1860, 817, 1432, 905, 1445, 1057, 1975, 1054) + +[node name="East Exit" type="Area2D" parent="." unique_id=100473542] +position = Vector2(-38, 12) +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("5_8froy") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="East Exit" unique_id=1358787735] +position = Vector2(1957, 934) +shape = SubResource("RectangleShape2D_5t4nn") + +[node name="West Exit" type="Area2D" parent="." unique_id=2018443347] +position = Vector2(1836, 944) +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("4_8froy") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="West Exit" unique_id=1394680927] +position = Vector2(-1826, 165) +shape = SubResource("RectangleShape2D_d67dk") + +[node name="East Entrance" type="Marker2D" parent="." unique_id=1551667945] +position = Vector2(1731, 937) + +[node name="West Entrance" type="Marker2D" parent="." unique_id=90243493] +position = Vector2(195, 1131) + +[node name="South Entrance" type="Marker2D" parent="." unique_id=615804952] +position = Vector2(945, 1123) + +[node name="Kitchen" type="Sprite2D" parent="." unique_id=929834458] +texture = ExtResource("1_8froy") +centered = false +flip_h = true +region_enabled = true +region_rect = Rect2(0, 0, 1920, 1080) + +[node name="Island" type="Sprite2D" parent="." unique_id=1972903081] +position = Vector2(774, 987) +texture = ExtResource("1_8froy") +centered = false +offset = Vector2(0, -412) +flip_h = true +region_enabled = true +region_rect = Rect2(7, 1094, 728, 412) + +[node name="Chair" type="Sprite2D" parent="." unique_id=407782373] +position = Vector2(1512, 1079) +texture = ExtResource("1_8froy") +centered = false +offset = Vector2(0, -322) +flip_h = true +region_enabled = true +region_rect = Rect2(860, 1109, 408, 322) + +[node name="Player" parent="." unique_id=1952104269 instance=ExtResource("4_8uwkb")] +unique_name_in_owner = true +position = Vector2(1722.0001, 936.00006) +scale = Vector2(3, 3) + +[node name="Magus" parent="." unique_id=166157348 instance=ExtResource("6_d2q7u")] +position = Vector2(663, 831) +scale = Vector2(12, 12) + +[node name="Magus Dialogue" type="Area2D" parent="." unique_id=649036673] +collision_layer = 32768 +collision_mask = 32768 +script = ExtResource("9_8iblu") +dialogue_resource = ExtResource("10_mdb7i") +dialogue_cue = "start" +metadata/_custom_type_script = "uid://e22lo1h2ovr7" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Magus Dialogue" unique_id=452716105] +position = Vector2(699, 669.0417) +shape = SubResource("RectangleShape2D_y2vya") + +[node name="Label" type="Label" parent="Magus Dialogue" unique_id=1810741347] +visible = false +offset_left = 670.0 +offset_top = 396.0 +offset_right = 729.0 +offset_bottom = 434.0 +text = "Talk" +label_settings = ExtResource("7_5jiw2") + +[connection signal="body_entered" from="East Exit" to="East Exit" method="_on_body_entered"] +[connection signal="body_entered" from="West Exit" to="West Exit" method="_on_body_entered"] diff --git a/scenes/kitchen_mirror/scripts/east_exit.gd b/scenes/kitchen_mirror/scripts/east_exit.gd new file mode 100644 index 0000000..d873586 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/east_exit.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "West Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen/kitchen.tscn") diff --git a/scenes/kitchen_mirror/scripts/east_exit.gd.uid b/scenes/kitchen_mirror/scripts/east_exit.gd.uid new file mode 100644 index 0000000..5077029 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/east_exit.gd.uid @@ -0,0 +1 @@ +uid://ddi7n13cestbt diff --git a/scenes/kitchen_mirror/scripts/kitchen_mirror.gd b/scenes/kitchen_mirror/scripts/kitchen_mirror.gd new file mode 100644 index 0000000..58654ee --- /dev/null +++ b/scenes/kitchen_mirror/scripts/kitchen_mirror.gd @@ -0,0 +1,12 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + if Global.player_entrance_name: + %Player.global_position = get_node(Global.player_entrance_name).global_position + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/scenes/kitchen_mirror/scripts/kitchen_mirror.gd.uid b/scenes/kitchen_mirror/scripts/kitchen_mirror.gd.uid new file mode 100644 index 0000000..e7b2dbb --- /dev/null +++ b/scenes/kitchen_mirror/scripts/kitchen_mirror.gd.uid @@ -0,0 +1 @@ +uid://d13cdc8w03klw diff --git a/scenes/kitchen_mirror/scripts/magus_interaction.gd b/scenes/kitchen_mirror/scripts/magus_interaction.gd new file mode 100644 index 0000000..0ea4a63 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/magus_interaction.gd @@ -0,0 +1,25 @@ +extends Area2D + +var inside = false; +# 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 _input(event): + if Input.is_action_just_pressed("interact"): + %Player.play_animation("drink",2100) + + +func _on_body_entered(body: Node2D) -> void: + $Label.visible = true + inside = true + + +func _on_body_exited(body: Node2D) -> void: + $Label.visible = false + inside = true diff --git a/scenes/kitchen_mirror/scripts/magus_interaction.gd.uid b/scenes/kitchen_mirror/scripts/magus_interaction.gd.uid new file mode 100644 index 0000000..97e122f --- /dev/null +++ b/scenes/kitchen_mirror/scripts/magus_interaction.gd.uid @@ -0,0 +1 @@ +uid://3y84v7vdq0uo diff --git a/scenes/kitchen_mirror/scripts/south_exit.gd b/scenes/kitchen_mirror/scripts/south_exit.gd new file mode 100644 index 0000000..5625e3d --- /dev/null +++ b/scenes/kitchen_mirror/scripts/south_exit.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "South Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen/kitchen.tscn") diff --git a/scenes/kitchen_mirror/scripts/south_exit.gd.uid b/scenes/kitchen_mirror/scripts/south_exit.gd.uid new file mode 100644 index 0000000..675cd54 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/south_exit.gd.uid @@ -0,0 +1 @@ +uid://do4h840v8awtn diff --git a/scenes/kitchen_mirror/scripts/west_exit.gd b/scenes/kitchen_mirror/scripts/west_exit.gd new file mode 100644 index 0000000..99f0100 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/west_exit.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# 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 _on_body_entered(body: Node2D) -> void: + Global.player_entrance_name = "East Entrance" + get_tree().change_scene_to_file("res://scenes/kitchen/kitchen.tscn") diff --git a/scenes/kitchen_mirror/scripts/west_exit.gd.uid b/scenes/kitchen_mirror/scripts/west_exit.gd.uid new file mode 100644 index 0000000..aa82e36 --- /dev/null +++ b/scenes/kitchen_mirror/scripts/west_exit.gd.uid @@ -0,0 +1 @@ +uid://bm1tgx7c8cmbq diff --git a/shared/audio/music/unatco.mp3 b/shared/audio/music/unatco.mp3 new file mode 100644 index 0000000..1715a30 --- /dev/null +++ b/shared/audio/music/unatco.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4eeda80d706b0762da6cf326f23785b45ac7a8f1b7f153cb612bfa83633e4944 +size 3074334 diff --git a/shared/audio/music/unatco.mp3.import b/shared/audio/music/unatco.mp3.import new file mode 100644 index 0000000..e5824f6 --- /dev/null +++ b/shared/audio/music/unatco.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://fk8girwmung3" +path="res://.godot/imported/unatco.mp3-883b932c9cb4cdcb692fc0f711f7f84e.mp3str" + +[deps] + +source_file="res://shared/audio/music/unatco.mp3" +dest_files=["res://.godot/imported/unatco.mp3-883b932c9cb4cdcb692fc0f711f7f84e.mp3str"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/shared/audio/music/unatco.tscn b/shared/audio/music/unatco.tscn new file mode 100644 index 0000000..630a1d0 --- /dev/null +++ b/shared/audio/music/unatco.tscn @@ -0,0 +1,9 @@ +[gd_scene format=3 uid="uid://ci42q3y8u6ves"] + +[ext_resource type="AudioStream" uid="uid://fk8girwmung3" path="res://shared/audio/music/unatco.mp3" id="1_mppfb"] + +[node name="Unatco" type="Node" unique_id=1231749188] + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=1253179788] +stream = ExtResource("1_mppfb") +autoplay = true diff --git a/shared/fonts/Roboto-VariableFont_wdth,wght.ttf b/shared/fonts/Roboto-VariableFont_wdth,wght.ttf new file mode 100644 index 0000000..c6bb904 --- /dev/null +++ b/shared/fonts/Roboto-VariableFont_wdth,wght.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fe599aba604c33d7ac9bb5f642dd15198bf7fbf037b0bbb78b4dcb89d340fc5 +size 487768 diff --git a/shared/fonts/Roboto-VariableFont_wdth,wght.ttf.import b/shared/fonts/Roboto-VariableFont_wdth,wght.ttf.import new file mode 100644 index 0000000..ed484b9 --- /dev/null +++ b/shared/fonts/Roboto-VariableFont_wdth,wght.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cih8meutgemo1" +path="res://.godot/imported/Roboto-VariableFont_wdth,wght.ttf-64b35459266686c67cc4bfdc1e7c6493.fontdata" + +[deps] + +source_file="res://shared/fonts/Roboto-VariableFont_wdth,wght.ttf" +dest_files=["res://.godot/imported/Roboto-VariableFont_wdth,wght.ttf-64b35459266686c67cc4bfdc1e7c6493.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/shared/helpers/baloon.gd b/shared/helpers/baloon.gd new file mode 100644 index 0000000..1a0bfa3 --- /dev/null +++ b/shared/helpers/baloon.gd @@ -0,0 +1,148 @@ +extends CanvasLayer + + +@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer +@onready var dialogue_label: DialogueLabel = $DialogueLabel +@onready var responses_menu: DialogueResponsesMenu = %DialogueResponsesMenu + + +## The dialogue resource +var resource: DialogueResource + +## Temporary game states +var temporary_game_states: Array = [] + +## See if we are waiting for the player +var is_waiting_for_input: bool = false + +# Who is talking +var dialogue_marker: DialogueMarker + +## The current line +var dialogue_line: DialogueLine: + set(value): + if not value: + queue_free() + else: + dialogue_line = value + update_dialogue_line() + get: + return dialogue_line + + +func _ready() -> void: + dialogue_label.hide() + + Engine.get_singleton("DialogueManager").mutated.connect(_on_mutated) + + +func _unhandled_input(_event: InputEvent) -> void: + # Only the balloon is allowed to handle input while it's showing + get_viewport().set_input_as_handled() + + +## Start some dialogue +func start(dialogue_resource: DialogueResource, title: String, extra_game_states: Array = []) -> void: + if not is_node_ready(): + await ready + temporary_game_states = extra_game_states + is_waiting_for_input = false + resource = dialogue_resource + dialogue_line = await resource.get_next_dialogue_line(title, temporary_game_states) + + +## Go to the next line +func next(next_id: String) -> void: + dialogue_line = await resource.get_next_dialogue_line(next_id, temporary_game_states) + + +#region Helpers + + +func update_dialogue_line() -> void: + responses_menu.responses = [] + + dialogue_line.text = dialogue_line.text + + dialogue_label.hide() + dialogue_label.dialogue_line = dialogue_line + + # Set the colour and attach the dialogue to the character + dialogue_marker = DialogueMarker.find_for_character(dialogue_line.character) + if is_instance_valid(dialogue_marker): + dialogue_label.set("theme_override_colors/default_color", dialogue_marker.color) + dialogue_label.set("theme_override_colors/font_outline_color", dialogue_marker.color.darkened(0.4)) + dialogue_label.global_position = dialogue_marker.global_position - Vector2(dialogue_label.size.x * 0.5, dialogue_label.get_content_height()) + + dialogue_label.show() + dialogue_label.type_out() + + # Play sound and wait for sound to finish + var voice_path: String = "res://l10n/voice/en/%s.ogg" % [dialogue_line.static_id] + if ResourceLoader.exists(voice_path): + var stream = load(voice_path) + audio_stream_player.stream = stream + audio_stream_player.play() + + Events.character_started_talking.emit(dialogue_line.character) + await audio_stream_player.finished + Events.character_finished_talking.emit(dialogue_line.character) + else: + printerr("Voice missing: %s" % [voice_path]) + Events.character_started_talking.emit(dialogue_line.character) + await get_tree().create_timer(dialogue_line.text.length() * 0.05).timeout + Events.character_finished_talking.emit(dialogue_line.character) + + dialogue_label.hide() + + if dialogue_line.responses.size() == 0: + next(dialogue_line.next_id) + else: + responses_menu.responses = dialogue_line.responses + for item: RichTextLabel in responses_menu.get_menu_items(): + item.mouse_entered.connect(_on_response_mouse_entered.bind(item)) + item.focus_entered.connect(_on_response_focus_entered.bind(item)) + item.focus_exited.connect(_on_response_focus_exited.bind(item)) + item.gui_input.connect(_on_response_gui_input.bind(item)) + _on_response_focus_entered(responses_menu.get_menu_items()[0]) + +#endregion + +#region Signals + + +func _on_mutated(_mutation: Dictionary) -> void: + is_waiting_for_input = false + + +func _on_response_mouse_entered(item: Control) -> void: + if "Disallowed" in item.name: return + + item.grab_focus() + + +func _on_response_gui_input(event: InputEvent, item: Control) -> void: + if "Disallowed" in item.name: return + + get_viewport().set_input_as_handled() + + if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1: + next(dialogue_line.responses[item.get_index()].next_id) + elif event.is_action_pressed("ui_accept") and item in responses_menu.get_menu_items(): + next(dialogue_line.responses[item.get_index()].next_id) + + +func _on_response_focus_entered(item): + item.set("theme_override_colors/default_color", DialogueMarker.find_for_character("Jimmy").color) + + +func _on_response_focus_exited(item): + item.set("theme_override_colors/default_color", Color.WHITE) + + +func _on_dialogue_label_resized() -> void: + if is_instance_valid(dialogue_marker): + dialogue_label.global_position = dialogue_marker.global_position - Vector2(dialogue_label.size.x * 0.5, dialogue_label.get_content_height()) + + +#endregion diff --git a/shared/helpers/baloon.gd.uid b/shared/helpers/baloon.gd.uid new file mode 100644 index 0000000..fb85f71 --- /dev/null +++ b/shared/helpers/baloon.gd.uid @@ -0,0 +1 @@ +uid://dgfws7wit3bm8 diff --git a/shared/helpers/baloon.tscn b/shared/helpers/baloon.tscn new file mode 100644 index 0000000..3261b60 --- /dev/null +++ b/shared/helpers/baloon.tscn @@ -0,0 +1,65 @@ +[gd_scene format=3 uid="uid://fuap5c0yodp"] + +[ext_resource type="Script" uid="uid://dgfws7wit3bm8" path="res://shared/helpers/baloon.gd" id="1_wstok"] +[ext_resource type="Script" uid="uid://g32um0mltv5d" path="res://addons/dialogue_manager/nodes/dialogue_label/dialogue_label.gd" id="2_o0tk5"] +[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/nodes/responses_menu/dialogue_responses_menu.gd" id="3_8ed8v"] + +[sub_resource type="Theme" id="Theme_npl72"] +default_font_size = 26 + +[sub_resource type="Theme" id="Theme_cpad0"] +default_font_size = 26 + +[node name="Baloon" type="CanvasLayer" unique_id=202010879] +layer = 128 +script = ExtResource("1_wstok") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=893187917] + +[node name="DialogueLabel" type="RichTextLabel" parent="." unique_id=1902386087] +clip_contents = false +offset_right = 668.0 +offset_bottom = 107.0 +theme = SubResource("Theme_npl72") +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 5 +bbcode_enabled = true +text = "usey ipsum dolor sit amet. When you get lost in your imaginatory vagueness, your foresight will become a nimble vagrant. Go with the feeling of the nature. Take it easy. Know why you're here. And remember to balance your internal energy with the environment." +fit_content = true +scroll_active = false +horizontal_alignment = 1 +script = ExtResource("2_o0tk5") +seconds_per_step = 0.0 +skip_pause_at_abbreviations = PackedStringArray("Mr", "Mrs", "Ms", "Dr", "etc", "eg", "ex") +metadata/_custom_type_script = "uid://g32um0mltv5d" + +[node name="ColorRect" type="ColorRect" parent="." unique_id=299096319] +offset_top = 880.0 +offset_right = 1920.0 +offset_bottom = 1080.0 +color = Color(0, 0, 0, 0.3137255) + +[node name="MarginContainer" type="MarginContainer" parent="ColorRect" unique_id=163990779] +layout_mode = 0 +offset_right = 1920.0 +offset_bottom = 200.0 +theme_override_constants/margin_left = 20 + +[node name="DialogueResponsesMenu" type="VBoxContainer" parent="ColorRect/MarginContainer" unique_id=1800274106 node_paths=PackedStringArray("response_template")] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("3_8ed8v") +response_template = NodePath("../RichTextLabel") + +[node name="RichTextLabel" type="RichTextLabel" parent="ColorRect/MarginContainer" unique_id=666364923] +custom_minimum_size = Vector2(0, 32) +clip_contents = false +layout_mode = 2 +theme = SubResource("Theme_cpad0") +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 5 +text = "Response" +fit_content = true +scroll_active = false +meta_underlined = false +hint_underlined = false diff --git a/shared/helpers/baloon/balloon.gd b/shared/helpers/baloon/balloon.gd new file mode 100644 index 0000000..04a522a --- /dev/null +++ b/shared/helpers/baloon/balloon.gd @@ -0,0 +1,218 @@ +extends CanvasLayer +## A basic dialogue balloon for use with Dialogue Manager. + + +## The dialogue resource +@export var dialogue_resource: DialogueResource + +## Start from a given cue when using balloon as a [Node] in a scene. +@export var start_from_cue: String = "" + +## If running as a [Node] in a scene then auto start the dialogue. +@export var auto_start: bool = false + +## If all other input is blocked as long as dialogue is shown. +@export var will_block_other_input: bool = true + +## The action to use for advancing the dialogue +@export var next_action: StringName = &"ui_accept" + +## The action to use to skip typing the dialogue +@export var skip_action: StringName = &"ui_cancel" + +## A sound player for voice lines (if they exist). +@onready var audio_stream_player: AudioStreamPlayer = %AudioStreamPlayer + +## Temporary game states +var temporary_game_states: Array = [] + +## See if we are waiting for the player +var is_waiting_for_input: bool = false + +## See if we are running a long mutation and should hide the balloon +var will_hide_balloon: bool = false + +## A dictionary to store any ephemeral variables +var locals: Dictionary = {} + +var _locale: String = TranslationServer.get_locale() + +## The current line +var dialogue_line: DialogueLine: + set(value): + if value: + dialogue_line = value + apply_dialogue_line() + else: + # The dialogue has finished so close the balloon + if owner == null: + queue_free() + else: + hide() + get: + return dialogue_line + +## A cooldown timer for delaying the balloon hide when encountering a mutation. +var mutation_cooldown: Timer = Timer.new() + +## The base balloon anchor +@onready var balloon: Control = %Balloon + +## The label showing the name of the currently speaking character +@onready var character_label: RichTextLabel = %CharacterLabel + +## The label showing the currently spoken dialogue +@onready var dialogue_label: DialogueLabel = %DialogueLabel + +## The menu of responses +@onready var responses_menu: DialogueResponsesMenu = %ResponsesMenu + +## Indicator to show that player can progress dialogue. +@onready var progress: Polygon2D = %Progress + + +func _ready() -> void: + balloon.hide() + Engine.get_singleton("DialogueManager").mutated.connect(_on_mutated) + + # If the responses menu doesn't have a next action set, use this one + if responses_menu.next_action.is_empty(): + responses_menu.next_action = next_action + + mutation_cooldown.timeout.connect(_on_mutation_cooldown_timeout) + add_child(mutation_cooldown) + + if auto_start: + if not is_instance_valid(dialogue_resource): + assert(false, DMConstants.get_error_message(DMConstants.ERR_MISSING_RESOURCE_FOR_AUTOSTART)) + start() + + + +func _process(_delta: float) -> void: + if is_instance_valid(dialogue_line): + progress.visible = not dialogue_label.is_typing and dialogue_line.responses.size() == 0 and not dialogue_line.has_tag("voice") + + +func _unhandled_input(_event: InputEvent) -> void: + # Only the balloon is allowed to handle input while it's showing + if will_block_other_input: + get_viewport().set_input_as_handled() + + +func _notification(what: int) -> void: + ## Detect a change of locale and update the current dialogue line to show the new language + if what == NOTIFICATION_TRANSLATION_CHANGED and _locale != TranslationServer.get_locale() and is_instance_valid(dialogue_label): + _locale = TranslationServer.get_locale() + var visible_ratio: float = dialogue_label.visible_ratio + await dialogue_line.refresh() + if visible_ratio < 1: + dialogue_label.skip_typing() + + +## Start some dialogue +func start(with_dialogue_resource: DialogueResource = null, cue: String = "", extra_game_states: Array = []) -> void: + temporary_game_states = [self] + extra_game_states + is_waiting_for_input = false + if is_instance_valid(with_dialogue_resource): + dialogue_resource = with_dialogue_resource + if not cue.is_empty(): + start_from_cue = cue + dialogue_line = await dialogue_resource.get_next_dialogue_line(start_from_cue, temporary_game_states) + show() + + +## Apply any changes to the balloon given a new [DialogueLine]. +func apply_dialogue_line() -> void: + mutation_cooldown.stop() + + progress.hide() + is_waiting_for_input = false + balloon.focus_mode = Control.FOCUS_ALL + balloon.grab_focus() + + character_label.visible = not dialogue_line.character.is_empty() + character_label.text = tr(dialogue_line.character, "dialogue") + + dialogue_label.hide() + dialogue_label.dialogue_line = dialogue_line + + responses_menu.hide() + responses_menu.responses = dialogue_line.responses + + # Show our balloon + balloon.show() + will_hide_balloon = false + + dialogue_label.show() + if not dialogue_line.text.is_empty(): + dialogue_label.type_out() + await dialogue_label.finished_typing + + # Wait for next line + if dialogue_line.has_tag("voice"): + audio_stream_player.stream = load(dialogue_line.get_tag_value("voice")) + audio_stream_player.play() + await audio_stream_player.finished + next(dialogue_line.next_id) + elif dialogue_line.responses.size() > 0: + balloon.focus_mode = Control.FOCUS_NONE + responses_menu.show() + elif dialogue_line.time != "": + var time: float = dialogue_line.text.length() * 0.02 if dialogue_line.time == "auto" else dialogue_line.time.to_float() + await get_tree().create_timer(time).timeout + next(dialogue_line.next_id) + else: + is_waiting_for_input = true + balloon.focus_mode = Control.FOCUS_ALL + balloon.grab_focus() + + +## Go to the next line +func next(next_id: String) -> void: + dialogue_line = await dialogue_resource.get_next_dialogue_line(next_id, temporary_game_states) + + +#region Signals + + +func _on_mutation_cooldown_timeout() -> void: + if will_hide_balloon: + will_hide_balloon = false + balloon.hide() + + +func _on_mutated(mutation: Dictionary) -> void: + if not mutation.is_inline: + is_waiting_for_input = false + will_hide_balloon = true + mutation_cooldown.start(0.1) + + +func _on_balloon_gui_input(event: InputEvent) -> void: + # See if we need to skip typing of the dialogue + if dialogue_label.is_typing: + var mouse_was_clicked: bool = event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() + var skip_button_was_pressed: bool = event.is_action_pressed(skip_action) + if mouse_was_clicked or skip_button_was_pressed: + get_viewport().set_input_as_handled() + dialogue_label.skip_typing() + return + + if not is_waiting_for_input: return + if dialogue_line.responses.size() > 0: return + + # When there are no response options the balloon itself is the clickable thing + get_viewport().set_input_as_handled() + + if event is InputEventMouseButton and event.is_pressed() and event.button_index == MOUSE_BUTTON_LEFT: + next(dialogue_line.next_id) + elif event.is_action_pressed(next_action) and get_viewport().gui_get_focus_owner() == balloon: + next(dialogue_line.next_id) + + +func _on_responses_menu_response_selected(response: DialogueResponse) -> void: + next(response.next_id) + + +#endregion diff --git a/shared/helpers/baloon/balloon.gd.uid b/shared/helpers/baloon/balloon.gd.uid new file mode 100644 index 0000000..7a64978 --- /dev/null +++ b/shared/helpers/baloon/balloon.gd.uid @@ -0,0 +1 @@ +uid://c3e8iahlgql5h diff --git a/shared/helpers/baloon/balloon.tscn b/shared/helpers/baloon/balloon.tscn new file mode 100644 index 0000000..b18b177 --- /dev/null +++ b/shared/helpers/baloon/balloon.tscn @@ -0,0 +1,207 @@ +[gd_scene format=3 uid="uid://l5tlat8en4ms"] + +[ext_resource type="Script" uid="uid://c3e8iahlgql5h" path="res://shared/helpers/baloon/balloon.gd" id="1_36de5"] +[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/nodes/dialogue_label/dialogue_label.tscn" id="2_a8ve6"] +[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/nodes/responses_menu/dialogue_responses_menu.gd" id="3_72ixx"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0, 0, 0, 1) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color(0.329412, 0.329412, 0.329412, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ri4m3"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0.121569, 0.121569, 0.121569, 1) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color(1, 1, 1, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e0njw"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0, 0, 0, 1) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color(0.6, 0.6, 0.6, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qkmqt"] +bg_color = Color(0, 0, 0, 1) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="Theme" id="Theme_qq3yp"] +default_font_size = 20 +Button/styles/disabled = SubResource("StyleBoxFlat_spyqn") +Button/styles/focus = SubResource("StyleBoxFlat_ri4m3") +Button/styles/hover = SubResource("StyleBoxFlat_e0njw") +Button/styles/normal = SubResource("StyleBoxFlat_e0njw") +MarginContainer/constants/margin_bottom = 15 +MarginContainer/constants/margin_left = 30 +MarginContainer/constants/margin_right = 30 +MarginContainer/constants/margin_top = 15 +PanelContainer/styles/panel = SubResource("StyleBoxFlat_qkmqt") + +[sub_resource type="Animation" id="Animation_nlsx6"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Progress:position:y") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_qkmqt"] +resource_name = "progress" +loop_mode = 1 +step = 0.1 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Progress:position:y") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0, 0, 0, 0, 0), +"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.2, -0.0157438, -4, -0.2, 0.0112069, 0.25, 0, -4, -0.25, 0, 0.25, 0, 0, -0.2, 0.00299701, 0.25, 0), +"times": PackedFloat32Array(0, 0.1, 0.5, 0.6, 1) +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_1337t"] +_data = { +&"RESET": SubResource("Animation_nlsx6"), +&"progress": SubResource("Animation_qkmqt") +} + +[node name="ExampleBalloon" type="CanvasLayer" unique_id=38036521] +layer = 100 +script = ExtResource("1_36de5") + +[node name="Balloon" type="Control" parent="." unique_id=154399927] +unique_name_in_owner = true +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = SubResource("Theme_qq3yp") + +[node name="MarginContainer" type="MarginContainer" parent="Balloon" unique_id=1302081376] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -219.0 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="PanelContainer" type="PanelContainer" parent="Balloon/MarginContainer" unique_id=2145270309] +clip_children = 2 +layout_mode = 2 +mouse_filter = 1 + +[node name="MarginContainer" type="MarginContainer" parent="Balloon/MarginContainer/PanelContainer" unique_id=903640783] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Balloon/MarginContainer/PanelContainer/MarginContainer" unique_id=1685890612] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer" unique_id=1890134056] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="CharacterLabel" type="RichTextLabel" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer/VBoxContainer" unique_id=1567782692] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0.501961) +layout_mode = 2 +mouse_filter = 1 +bbcode_enabled = true +text = "Character" +fit_content = true +scroll_active = false + +[node name="DialogueLabel" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer/VBoxContainer" unique_id=1301798052 instance=ExtResource("2_a8ve6")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "Dialogue..." + +[node name="Control" type="Control" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer" unique_id=418507161] +custom_minimum_size = Vector2(20, 10) +layout_mode = 2 +size_flags_vertical = 8 + +[node name="Progress" type="Polygon2D" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer/Control" unique_id=2091292889] +unique_name_in_owner = true +polygon = PackedVector2Array(0, 0, 10, 10, 20, 0) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/HBoxContainer/Control" unique_id=1602634471] +libraries/ = SubResource("AnimationLibrary_1337t") +autoplay = &"progress" + +[node name="CenterContainer" type="CenterContainer" parent="Balloon" unique_id=1087901387] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="ResponsesMenu" type="VBoxContainer" parent="Balloon/CenterContainer" unique_id=1801308483 node_paths=PackedStringArray("response_template")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 8 +theme_override_constants/separation = 2 +alignment = 1 +script = ExtResource("3_72ixx") +response_template = NodePath("ResponseExample") + +[node name="ResponseExample" type="Button" parent="Balloon/CenterContainer/ResponsesMenu" unique_id=1446810977] +layout_mode = 2 +text = "Response example" + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=1162558754] +unique_name_in_owner = true + +[connection signal="gui_input" from="Balloon" to="." method="_on_balloon_gui_input"] +[connection signal="response_selected" from="Balloon/CenterContainer/ResponsesMenu" to="." method="_on_responses_menu_response_selected"] diff --git a/shared/helpers/dialogue_marker.gd b/shared/helpers/dialogue_marker.gd new file mode 100644 index 0000000..699e954 --- /dev/null +++ b/shared/helpers/dialogue_marker.gd @@ -0,0 +1,4 @@ +class_name DialogueMarker extends DialogueMarker2D + + +@export var color: Color diff --git a/shared/helpers/dialogue_marker.gd.uid b/shared/helpers/dialogue_marker.gd.uid new file mode 100644 index 0000000..f87ea6e --- /dev/null +++ b/shared/helpers/dialogue_marker.gd.uid @@ -0,0 +1 @@ +uid://bp4pd1ek1cqnn diff --git a/shared/helpers/hotspot.gd b/shared/helpers/hotspot.gd new file mode 100644 index 0000000..4867a29 --- /dev/null +++ b/shared/helpers/hotspot.gd @@ -0,0 +1,49 @@ +@tool + +class_name Hotspot extends DialogueActionable2D + +var inside = false +func _enter_tree() -> void: + #Input.set_custom_mouse_cursor(preload("res://helpers/pointers/arrow.svg")) + #Input.set_custom_mouse_cursor(preload("res://helpers/pointers/target.svg"), Input.CURSOR_POINTING_HAND) +# + #mouse_entered.connect(_on_mouse_entered) + #mouse_exited.connect(_on_mouse_exited) +# + input_event.connect(_on_input_event) + body_entered.connect(_on_body_entered) + body_exited.connect(_on_body_exited) + + +#region Signals + + +func _on_body_entered(body: Node2D) -> void: + $Label.visible = true + inside = true + + +func _on_body_exited(body: Node2D) -> void: + $Label.visible = false + inside = true + +#func _on_mouse_entered() -> void: + #Input.set_custom_mouse_cursor(preload("res://helpers/pointers/target.svg")) +# +# +#func _on_mouse_exited() -> void: + #Input.set_custom_mouse_cursor(preload("res://helpers/pointers/arrow.svg")) +# +# +func _input(event): + if inside and Input.is_action_just_pressed("interact"): + $Label.visible = false + action() + +func _on_input_event(_view_port: Node, event: InputEvent, _shape_idx: int) -> void: + if Input.is_action_just_pressed("interact"): + $Label.visible = false + action() + + +#endregion diff --git a/shared/helpers/hotspot.gd.uid b/shared/helpers/hotspot.gd.uid new file mode 100644 index 0000000..d71c11f --- /dev/null +++ b/shared/helpers/hotspot.gd.uid @@ -0,0 +1 @@ +uid://e22lo1h2ovr7 diff --git a/shared/resources/interaction.tscn b/shared/resources/interaction.tscn new file mode 100644 index 0000000..298700e --- /dev/null +++ b/shared/resources/interaction.tscn @@ -0,0 +1,19 @@ +[gd_scene format=3 uid="uid://pokhp7j2kahn"] + +[ext_resource type="LabelSettings" uid="uid://dkpp84p885g8h" path="res://shared/resources/standard_label_settings.tres" id="1_870w0"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_5t4nn"] +size = Vector2(74, 110) + +[node name="Interaction" type="Area2D" unique_id=1786805095] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=770966100] +position = Vector2(37, 55) +shape = SubResource("RectangleShape2D_5t4nn") + +[node name="ToolTip" type="Label" parent="." unique_id=103743226] +offset_top = -39.0 +offset_right = 61.0 +offset_bottom = -1.0 +text = "Text" +label_settings = ExtResource("1_870w0") diff --git a/shared/resources/standard_label_settings.tres b/shared/resources/standard_label_settings.tres new file mode 100644 index 0000000..525959e --- /dev/null +++ b/shared/resources/standard_label_settings.tres @@ -0,0 +1,11 @@ +[gd_resource type="LabelSettings" format=3 uid="uid://dkpp84p885g8h"] + +[ext_resource type="FontFile" uid="uid://cih8meutgemo1" path="res://shared/fonts/Roboto-VariableFont_wdth,wght.ttf" id="1_dmljj"] + +[resource] +font = ExtResource("1_dmljj") +font_size = 32 +outline_size = 10 +outline_color = Color(0, 0, 0, 1) +shadow_size = 5 +shadow_color = Color(0, 0, 0, 1) diff --git a/shared/scripts/Global.gd b/shared/scripts/Global.gd new file mode 100644 index 0000000..293b30a --- /dev/null +++ b/shared/scripts/Global.gd @@ -0,0 +1,13 @@ +extends Node + + +# 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 + +var player_entrance_name: String = "" diff --git a/shared/scripts/Global.gd.uid b/shared/scripts/Global.gd.uid new file mode 100644 index 0000000..4c816a1 --- /dev/null +++ b/shared/scripts/Global.gd.uid @@ -0,0 +1 @@ +uid://5qv3gwwiq6hf diff --git a/shared/scripts/events.gd b/shared/scripts/events.gd new file mode 100644 index 0000000..cb745a8 --- /dev/null +++ b/shared/scripts/events.gd @@ -0,0 +1,5 @@ +extends Node + + +signal character_started_talking(character_name: String) +signal character_finished_talking(character_name: String) diff --git a/shared/scripts/events.gd.uid b/shared/scripts/events.gd.uid new file mode 100644 index 0000000..831e41b --- /dev/null +++ b/shared/scripts/events.gd.uid @@ -0,0 +1 @@ +uid://bam75tp2cvnnv