From 8b50656df53f0d3a09b1dd9465c4039fc5de0df4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 26 Apr 2024 03:57:07 +0200 Subject: [PATCH] Add all entities --- entities/chupacabra.tscn | 10 +- entities/cthulhu.gd | 23 ++++ entities/cthulhu.tscn | 244 +++++++++++++++++++++++++++++++++++++ entities/imp.gd | 4 +- entities/imp.tscn | 2 + entities/sheep.gd | 2 +- entities/sheep.tscn | 1 + entities/watcher.gd | 24 ++++ entities/watcher.tscn | 201 ++++++++++++++++++++++++++++++ scenes/game/main_game.tscn | 10 +- 10 files changed, 512 insertions(+), 9 deletions(-) create mode 100644 entities/cthulhu.gd create mode 100644 entities/cthulhu.tscn create mode 100644 entities/watcher.gd create mode 100644 entities/watcher.tscn diff --git a/entities/chupacabra.tscn b/entities/chupacabra.tscn index 9f94c68..876c1a3 100644 --- a/entities/chupacabra.tscn +++ b/entities/chupacabra.tscn @@ -266,7 +266,7 @@ tracks/4/keys = { [sub_resource type="Animation" id="Animation_fsmcn"] resource_name = "sit" -length = 0.4 +length = 0.5 loop_mode = 2 tracks/0/type = "value" tracks/0/imported = false @@ -284,13 +284,13 @@ tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true tracks/1/path = NodePath("Sprite:rotation") -tracks/1/interp = 1 +tracks/1/interp = 2 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(0, 0.4), +"times": PackedFloat32Array(0, 0.5), "transitions": PackedFloat32Array(1, 1), "update": 0, -"values": [0.0, -0.0349066] +"values": [0.0349066, -0.0349066] } tracks/2/type = "value" tracks/2/imported = false @@ -453,8 +453,8 @@ stream = ExtResource("17_ccla5") [connection signal="changed_direction" from="MovementWander" to="MovementWander/WanderPriority" method="priority_conditional"] [connection signal="move" from="MovementWander" to="." method="_on_move"] [connection signal="move_disabled" from="MovementWander" to="MovementWander" method="clear_direction"] -[connection signal="move_disabled" from="MovementWander" to="MovementWander/StopMovingTimer" method="stop"] [connection signal="move_disabled" from="MovementWander" to="MovementWander/StartMovingTimer" method="stop"] +[connection signal="move_disabled" from="MovementWander" to="MovementWander/StopMovingTimer" method="stop"] [connection signal="move_enabled" from="MovementWander" to="MovementWander/StartMovingTimer" method="start"] [connection signal="move_enabled" from="MovementWander" to="Animator" method="play" binds= [&"sit"]] [connection signal="timeout" from="MovementWander/StartMovingTimer" to="MovementWander" method="randomize_direction"] diff --git a/entities/cthulhu.gd b/entities/cthulhu.gd new file mode 100644 index 0000000..593bdc0 --- /dev/null +++ b/entities/cthulhu.gd @@ -0,0 +1,23 @@ +extends CharacterBody2D +class_name Cthulhu + + +@onready var sprite: SpriteLeftRight = %"Sprite" +@onready var animator: AnimationPlayer = %"Animator" + + +func _on_move(movement: Vector2): + move_and_collide(movement) + sprite.handle_move(movement) + +func _on_dragged(_cursor: Cursor) -> void: + collision_layer = 16 + collision_mask = 18 + z_index = 1 + animator.play(&"drag_start") + +func _on_fallen() -> void: + collision_layer = 8 + collision_mask = 14 + z_index = 0 + animator.play(&"RESET") diff --git a/entities/cthulhu.tscn b/entities/cthulhu.tscn new file mode 100644 index 0000000..737376f --- /dev/null +++ b/entities/cthulhu.tscn @@ -0,0 +1,244 @@ +[gd_scene load_steps=19 format=3 uid="uid://gl4umoff474y"] + +[ext_resource type="PackedScene" uid="uid://bxbjfev0lhwws" path="res://behaviours/sprite_left_right.tscn" id="1_a8ato"] +[ext_resource type="Script" path="res://entities/cthulhu.gd" id="1_b55wc"] +[ext_resource type="Texture2D" uid="uid://17komk2y0f4e" path="res://entities/cthulhu_left.png" id="2_13vnj"] +[ext_resource type="Texture2D" uid="uid://bs6es4d3fvunw" path="res://entities/cthulhu_right.png" id="4_1wxgg"] +[ext_resource type="Texture2D" uid="uid://6revaeis55q1" path="res://entities/cthulhu_drag_left.png" id="5_6ho60"] +[ext_resource type="Texture2D" uid="uid://b0tlt1tgukajd" path="res://entities/cthulhu_drag_right.png" id="6_behik"] +[ext_resource type="PackedScene" uid="uid://djcwis8ycrq85" path="res://behaviours/sampler_priority.tscn" id="6_truco"] +[ext_resource type="PackedScene" uid="uid://rx24bppccih7" path="res://behaviours/move_physics.tscn" id="8_mvkr6"] +[ext_resource type="PackedScene" uid="uid://cm67ko1k6kn4u" path="res://behaviours/priority.tscn" id="9_7b55p"] +[ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="10_c36ur"] +[ext_resource type="AudioStream" uid="uid://d0feiq5s6fnux" path="res://entities/imp_drag.wav" id="11_jt7u1"] +[ext_resource type="AudioStream" uid="uid://cwsg776c11xfc" path="res://entities/fall.ogg" id="12_v8da5"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_uw0y6"] +radius = 50.0 + +[sub_resource type="Animation" id="Animation_aspa2"] +resource_name = "RESET" +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("SpriteFocus/Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(2, 2)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("SpriteFocus/Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("2_13vnj")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("SpriteFocus/Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("4_1wxgg")] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("SpriteFocus:rotation") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_qhrn0"] +resource_name = "drag_start" +length = 0.4 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("SpriteFocus/Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.4), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(2, 2), Vector2(2.4, 2.4)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("SpriteFocus/Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("5_6ho60")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("SpriteFocus/Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("6_behik")] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("SpriteFocus:rotation") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_iyn5h"] +resource_name = "drag_loop" +length = 2.0 +loop_mode = 2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("SpriteFocus/Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(2.4, 2.4)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("SpriteFocus/Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("5_6ho60")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("SpriteFocus/Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("6_behik")] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("SpriteFocus:rotation") +tracks/3/interp = 2 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [-0.10472, 0.10472] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_clmy5"] +_data = { +"RESET": SubResource("Animation_aspa2"), +"drag_loop": SubResource("Animation_iyn5h"), +"drag_start": SubResource("Animation_qhrn0") +} + +[sub_resource type="CircleShape2D" id="CircleShape2D_ptf8q"] +radius = 50.0 + +[node name="Cthulhu" type="CharacterBody2D"] +collision_layer = 8 +collision_mask = 14 +script = ExtResource("1_b55wc") + +[node name="SpriteFocus" type="Node2D" parent="."] + +[node name="Sprite" parent="SpriteFocus" instance=ExtResource("1_a8ato")] +unique_name_in_owner = true +position = Vector2(0, 48) +scale = Vector2(2, 2) +texture = ExtResource("2_13vnj") +left_texture = ExtResource("2_13vnj") +right_texture = ExtResource("4_1wxgg") + +[node name="Shape" type="CollisionShape2D" parent="."] +position = Vector2(0, 36) +shape = SubResource("CircleShape2D_uw0y6") + +[node name="Animator" type="AnimationPlayer" parent="."] +unique_name_in_owner = true +libraries = { +"": SubResource("AnimationLibrary_clmy5") +} +next/drag_start = &"drag_loop" +next/drag_loop = &"drag_loop" +blend_times = [&"drag_start", &"drag_loop", 0.5] + +[node name="MovementSampler" parent="." instance=ExtResource("6_truco")] + +[node name="MovementDrag" parent="." instance=ExtResource("8_mvkr6")] +position = Vector2(1, 0) +enabled = false + +[node name="DragPriority" parent="MovementDrag" instance=ExtResource("9_7b55p")] +alternative_priority = 50 + +[node name="Draggable" parent="MovementDrag" instance=ExtResource("10_c36ur")] +position = Vector2(0, 36) + +[node name="Shape" type="CollisionShape2D" parent="MovementDrag/Draggable"] +shape = SubResource("CircleShape2D_ptf8q") +debug_color = Color(1, 1, 1, 0) + +[node name="DragSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("11_jt7u1") + +[node name="FallSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("12_v8da5") + +[connection signal="dragged" from="MovementDrag" to="." method="_on_dragged"] +[connection signal="dragged" from="MovementDrag" to="MovementDrag/DragPriority" method="priority_alternative" unbinds=1] +[connection signal="dragged" from="MovementDrag" to="MovementDrag/DragSound" method="play" unbinds=1] +[connection signal="fallen" from="MovementDrag" to="." method="_on_fallen"] +[connection signal="fallen" from="MovementDrag" to="MovementDrag/DragPriority" method="priority_default"] +[connection signal="fallen" from="MovementDrag" to="MovementDrag/FallSound" method="play"] +[connection signal="move" from="MovementDrag" to="." method="_on_move"] +[connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"] +[connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"] diff --git a/entities/imp.gd b/entities/imp.gd index b75e2b1..e40bd23 100644 --- a/entities/imp.gd +++ b/entities/imp.gd @@ -2,8 +2,8 @@ extends CharacterBody2D class_name Imp -@onready var sprite: SpriteLeftRight = $"Sprite" -@onready var eater: Eater = $"Eater" +@onready var sprite: SpriteLeftRight = %"Sprite" +@onready var eater: Eater = %"Eater" @onready var animator: AnimationPlayer = %"Animator" diff --git a/entities/imp.tscn b/entities/imp.tscn index eba279a..10a8b93 100644 --- a/entities/imp.tscn +++ b/entities/imp.tscn @@ -227,6 +227,7 @@ motion_mode = 1 script = ExtResource("1_dixpc") [node name="Sprite" parent="." instance=ExtResource("2_eqcdi")] +unique_name_in_owner = true scale = Vector2(2, 2) texture = ExtResource("3_qda0k") left_texture = ExtResource("3_qda0k") @@ -306,6 +307,7 @@ stream = ExtResource("16_0frai") stream = ExtResource("17_lib0h") [node name="Eater" parent="." instance=ExtResource("14_w2h8x")] +unique_name_in_owner = true acceptable_diets = Array[StringName]([&"Meat"]) [node name="Shape" type="CollisionShape2D" parent="Eater"] diff --git a/entities/sheep.gd b/entities/sheep.gd index 07f36ef..41ac5c0 100644 --- a/entities/sheep.gd +++ b/entities/sheep.gd @@ -2,7 +2,7 @@ extends CharacterBody2D class_name Sheep -@onready var sprite: SpriteLeftRight = $"Sprite" +@onready var sprite: SpriteLeftRight = %"Sprite" @onready var animator: AnimationPlayer = %"Animator" diff --git a/entities/sheep.tscn b/entities/sheep.tscn index 0743f62..80ba1be 100644 --- a/entities/sheep.tscn +++ b/entities/sheep.tscn @@ -197,6 +197,7 @@ motion_mode = 1 script = ExtResource("1_4dmll") [node name="Sprite" parent="." instance=ExtResource("2_xbkrm")] +unique_name_in_owner = true position = Vector2(0, -4) scale = Vector2(2, 2) texture = ExtResource("2_t13f5") diff --git a/entities/watcher.gd b/entities/watcher.gd new file mode 100644 index 0000000..850f350 --- /dev/null +++ b/entities/watcher.gd @@ -0,0 +1,24 @@ +extends CharacterBody2D +class_name Watcher + + +@onready var sprite: SpriteLeftRight = %"Sprite" +@onready var animator: AnimationPlayer = %"Animator" + + + +func _on_move(movement: Vector2): + move_and_collide(movement) + sprite.handle_move(movement) + +func _on_dragged(_cursor: Cursor) -> void: + collision_layer = 16 + collision_mask = 18 + z_index = 1 + animator.play(&"drag_start") + +func _on_fallen() -> void: + collision_layer = 8 + collision_mask = 14 + z_index = 0 + animator.play(&"RESET") diff --git a/entities/watcher.tscn b/entities/watcher.tscn new file mode 100644 index 0000000..5fa7b11 --- /dev/null +++ b/entities/watcher.tscn @@ -0,0 +1,201 @@ +[gd_scene load_steps=19 format=3 uid="uid://dnjtduk0hla3f"] + +[ext_resource type="Script" path="res://entities/watcher.gd" id="1_brahc"] +[ext_resource type="PackedScene" uid="uid://bxbjfev0lhwws" path="res://behaviours/sprite_left_right.tscn" id="1_thu73"] +[ext_resource type="Texture2D" uid="uid://by6igmr52nlyi" path="res://entities/watcher_left.png" id="2_32yw7"] +[ext_resource type="Texture2D" uid="uid://c6tbab5h4osj5" path="res://entities/watcher_right.png" id="3_k8fgk"] +[ext_resource type="PackedScene" uid="uid://djcwis8ycrq85" path="res://behaviours/sampler_priority.tscn" id="4_i1htf"] +[ext_resource type="Texture2D" uid="uid://dh61knesgvjs" path="res://entities/watcher_drag_left.png" id="7_ff3vx"] +[ext_resource type="Texture2D" uid="uid://b6uurud5clnqr" path="res://entities/watcher_drag_right.png" id="8_5nq2n"] +[ext_resource type="PackedScene" uid="uid://rx24bppccih7" path="res://behaviours/move_physics.tscn" id="8_jy8ay"] +[ext_resource type="PackedScene" uid="uid://cm67ko1k6kn4u" path="res://behaviours/priority.tscn" id="9_wtsor"] +[ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="10_qbgiu"] +[ext_resource type="AudioStream" uid="uid://d0feiq5s6fnux" path="res://entities/imp_drag.wav" id="11_rydo5"] +[ext_resource type="AudioStream" uid="uid://cwsg776c11xfc" path="res://entities/fall.ogg" id="12_0h21e"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_diig7"] +radius = 32.0 + +[sub_resource type="Animation" id="Animation_gokbg"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(2, 2)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("2_32yw7")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("3_k8fgk")] +} + +[sub_resource type="Animation" id="Animation_5yt72"] +resource_name = "drag_loop" +length = 2.0 +loop_mode = 2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(2.4, 2.4)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("7_ff3vx")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("8_5nq2n")] +} + +[sub_resource type="Animation" id="Animation_2igbw"] +resource_name = "drag_start" +length = 0.2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(2, 2), Vector2(2.4, 2.4)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite:left_texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("2_32yw7")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite:right_texture") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("3_k8fgk")] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_yam4u"] +_data = { +"RESET": SubResource("Animation_gokbg"), +"drag_loop": SubResource("Animation_5yt72"), +"drag_start": SubResource("Animation_2igbw") +} + +[sub_resource type="CircleShape2D" id="CircleShape2D_ywwo3"] +radius = 32.0 + +[node name="Watcher" type="CharacterBody2D"] +collision_layer = 8 +collision_mask = 14 +script = ExtResource("1_brahc") + +[node name="Sprite" parent="." instance=ExtResource("1_thu73")] +unique_name_in_owner = true +scale = Vector2(2, 2) +texture = ExtResource("2_32yw7") +left_texture = ExtResource("2_32yw7") +right_texture = ExtResource("3_k8fgk") + +[node name="Shape" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_diig7") + +[node name="Animator" type="AnimationPlayer" parent="."] +unique_name_in_owner = true +libraries = { +"": SubResource("AnimationLibrary_yam4u") +} +next/drag_loop = &"drag_loop" +next/drag_start = &"drag_loop" + +[node name="MovementSampler" parent="." instance=ExtResource("4_i1htf")] + +[node name="MovementDrag" parent="." instance=ExtResource("8_jy8ay")] +position = Vector2(1, 0) +enabled = false + +[node name="DragPriority" parent="MovementDrag" instance=ExtResource("9_wtsor")] +alternative_priority = 50 + +[node name="Draggable" parent="MovementDrag" instance=ExtResource("10_qbgiu")] + +[node name="Shape" type="CollisionShape2D" parent="MovementDrag/Draggable"] +shape = SubResource("CircleShape2D_ywwo3") +debug_color = Color(1, 1, 1, 0) + +[node name="DragSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("11_rydo5") + +[node name="FallSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("12_0h21e") + +[connection signal="dragged" from="MovementDrag" to="." method="_on_dragged"] +[connection signal="dragged" from="MovementDrag" to="MovementDrag/DragPriority" method="priority_alternative" unbinds=1] +[connection signal="dragged" from="MovementDrag" to="MovementDrag/DragSound" method="play" unbinds=1] +[connection signal="fallen" from="MovementDrag" to="." method="_on_fallen"] +[connection signal="fallen" from="MovementDrag" to="MovementDrag/DragPriority" method="priority_default"] +[connection signal="fallen" from="MovementDrag" to="MovementDrag/FallSound" method="play"] +[connection signal="move" from="MovementDrag" to="." method="_on_move"] +[connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"] +[connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"] diff --git a/scenes/game/main_game.tscn b/scenes/game/main_game.tscn index 98d82bc..99f8c1e 100644 --- a/scenes/game/main_game.tscn +++ b/scenes/game/main_game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://cxj5aud02f40j"] +[gd_scene load_steps=21 format=3 uid="uid://cxj5aud02f40j"] [ext_resource type="Script" path="res://scenes/game/main_game.gd" id="1_wiglu"] [ext_resource type="PackedScene" uid="uid://dm068vaseh45n" path="res://scenes/game/game_camera.tscn" id="2_db5xs"] @@ -13,6 +13,8 @@ [ext_resource type="PackedScene" uid="uid://bc2bm8lbol18w" path="res://entities/sheep.tscn" id="9_qrqqu"] [ext_resource type="PackedScene" uid="uid://4d3ksr3171x4" path="res://entities/imp.tscn" id="10_yw228"] [ext_resource type="PackedScene" uid="uid://cmemgijh6nfmk" path="res://entities/chupacabra.tscn" id="11_ixo4x"] +[ext_resource type="PackedScene" uid="uid://dnjtduk0hla3f" path="res://entities/watcher.tscn" id="14_8rumi"] +[ext_resource type="PackedScene" uid="uid://gl4umoff474y" path="res://entities/cthulhu.tscn" id="15_k41qf"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_058kb"] texture = ExtResource("2_o7bg5") @@ -938,3 +940,9 @@ position = Vector2(-177, 154) [node name="Chupacabra" parent="." instance=ExtResource("11_ixo4x")] position = Vector2(6, -210) + +[node name="Watcher" parent="." instance=ExtResource("14_8rumi")] +position = Vector2(189, 171) + +[node name="Cthulhu" parent="." instance=ExtResource("15_k41qf")] +position = Vector2(226, -137)