diff --git a/entities/imp.gd b/entities/imp.gd index b269e7d..b5fb24e 100644 --- a/entities/imp.gd +++ b/entities/imp.gd @@ -13,14 +13,13 @@ func _on_move(movement: Vector2): func _on_eater_eaten(edible: Edible) -> void: edible.get_parent().queue_free() - -func _on_draggable_dragged(_cursor: Cursor) -> void: +func _on_dragged(_cursor: Cursor) -> void: collision_layer = 16 collision_mask = 18 z_index = 1 eater.collision_mask = 16 -func _on_draggable_dropped() -> void: +func _on_fallen() -> void: collision_layer = 8 collision_mask = 14 z_index = 0 diff --git a/entities/imp.tscn b/entities/imp.tscn index 70e2a7a..299010d 100644 --- a/entities/imp.tscn +++ b/entities/imp.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=3 uid="uid://4d3ksr3171x4"] +[gd_scene load_steps=23 format=3 uid="uid://4d3ksr3171x4"] [ext_resource type="Script" path="res://entities/imp.gd" id="1_dixpc"] [ext_resource type="PackedScene" uid="uid://bxbjfev0lhwws" path="res://behaviours/sprite_left_right.tscn" id="2_eqcdi"] @@ -16,6 +16,8 @@ [ext_resource type="PackedScene" uid="uid://rx24bppccih7" path="res://behaviours/move_physics.tscn" id="14_p3w0g"] [ext_resource type="PackedScene" uid="uid://jg7qkbswgqjc" path="res://behaviours/eater.tscn" id="14_w2h8x"] [ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="15_otrbh"] +[ext_resource type="AudioStream" uid="uid://bmfscpnugaejk" path="res://entities/sheep_drag.wav" id="16_0nbhd"] +[ext_resource type="AudioStream" uid="uid://cwsg776c11xfc" path="res://entities/fall.ogg" id="17_lib0h"] [sub_resource type="CircleShape2D" id="CircleShape2D_ide4n"] radius = 32.0 @@ -101,6 +103,12 @@ alternative_priority = 50 shape = SubResource("CircleShape2D_50iad") debug_color = Color(1, 1, 1, 0) +[node name="DragSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("16_0nbhd") + +[node name="FallSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("17_lib0h") + [node name="Eater" parent="." instance=ExtResource("14_w2h8x")] acceptable_diets = Array[StringName]([&"Meat"]) @@ -121,12 +129,14 @@ debug_color = Color(1, 0, 0, 0) [connection signal="untracked" from="MovementHunt/TrackerMeat" to="MovementHunt/TrackerMeat/TargetPicker" method="clear_if_target"] [connection signal="target_changed" from="MovementHunt/TrackerMeat/TargetPicker" to="MovementHunt" method="set_target" unbinds=1] [connection signal="target_changed" from="MovementHunt/TrackerMeat/TargetPicker" to="MovementHunt/TrackerMeat/TargetPicker" method="sample_target_if_null" unbinds=2] +[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="priority_changed_no_args" from="MovementDrag/DragPriority" to="MovementSampler" method="enable"] -[connection signal="dragged" from="MovementDrag/Draggable" to="." method="_on_draggable_dragged"] [connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"] -[connection signal="dropped" from="MovementDrag/Draggable" to="." method="_on_draggable_dropped"] [connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"] [connection signal="eaten" from="Eater" to="." method="_on_eater_eaten"] diff --git a/entities/monocle.tscn b/entities/monocle.tscn index 3de9b9d..d430b42 100644 --- a/entities/monocle.tscn +++ b/entities/monocle.tscn @@ -10,7 +10,7 @@ radius = 12.0 [sub_resource type="CircleShape2D" id="CircleShape2D_juisb"] -radius = 24.0 +radius = 12.0 [node name="Monocle" type="CharacterBody2D"] collision_layer = 8 diff --git a/entities/sheep.gd b/entities/sheep.gd index 68aa731..e28982c 100644 --- a/entities/sheep.gd +++ b/entities/sheep.gd @@ -13,13 +13,12 @@ func _on_move(movement: Vector2) -> void: move_and_collide(movement) sprite.handle_move(movement) - -func _on_draggable_dragged(_cursor: Cursor) -> void: +func _on_dragged(_cursor: Cursor) -> void: collision_layer = 16 collision_mask = 18 z_index = 1 -func _on_draggable_dropped() -> void: +func _on_fallen() -> void: collision_layer = 8 collision_mask = 14 z_index = 0 diff --git a/entities/sheep.tscn b/entities/sheep.tscn index e9c22d9..b07e995 100644 --- a/entities/sheep.tscn +++ b/entities/sheep.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=22 format=3 uid="uid://bc2bm8lbol18w"] +[gd_scene load_steps=24 format=3 uid="uid://bc2bm8lbol18w"] [ext_resource type="Script" path="res://entities/sheep.gd" id="1_4dmll"] [ext_resource type="Texture2D" uid="uid://iljp5yn3ehfk" path="res://entities/sheep_left.png" id="2_t13f5"] @@ -15,6 +15,8 @@ [ext_resource type="PackedScene" uid="uid://dijcjahkddudv" path="res://behaviours/draggable.tscn" id="14_0b1hs"] [ext_resource type="PackedScene" uid="uid://rx24bppccih7" path="res://behaviours/move_physics.tscn" id="14_3wojv"] [ext_resource type="PackedScene" uid="uid://c5pyp5hvthdof" path="res://behaviours/tracker_tracker.tscn" id="14_eqowb"] +[ext_resource type="AudioStream" uid="uid://bmfscpnugaejk" path="res://entities/sheep_drag.wav" id="16_nswfl"] +[ext_resource type="AudioStream" uid="uid://cwsg776c11xfc" path="res://entities/fall.ogg" id="17_8kst2"] [sub_resource type="CircleShape2D" id="CircleShape2D_c5tcn"] radius = 8.0 @@ -176,6 +178,12 @@ scale = Vector2(3, 3) shape = SubResource("CircleShape2D_c5tcn") debug_color = Color(1, 1, 1, 0) +[node name="DragSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("16_nswfl") + +[node name="FallSound" type="AudioStreamPlayer2D" parent="MovementDrag"] +stream = ExtResource("17_8kst2") + [connection signal="ready" from="MovementSampler" to="MovementSampler" method="enable"] [connection signal="move" from="MovementIdle" to="." method="_on_move"] [connection signal="move_disabled" from="MovementIdle" to="MovementIdle/BoredTimer" method="stop"] @@ -201,12 +209,14 @@ debug_color = Color(1, 1, 1, 0) [connection signal="tracked" from="MovementRunFromHunter/HunterSense" to="MovementRunFromHunter/HunterSense/TargetPicker" method="set_target_if_null"] [connection signal="untracked" from="MovementRunFromHunter/HunterSense" to="MovementRunFromHunter/HunterSense/TargetPicker" method="clear_if_target"] [connection signal="target_changed" from="MovementRunFromHunter/HunterSense/TargetPicker" to="MovementRunFromHunter" method="set_target" unbinds=1] +[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="move_enabled" from="MovementDrag" to="MovementWander" method="clear_direction"] [connection signal="priority_changed_no_args" from="MovementDrag/DragPriority" to="MovementSampler" method="enable"] -[connection signal="dragged" from="MovementDrag/Draggable" to="." method="_on_draggable_dragged"] [connection signal="dragged" from="MovementDrag/Draggable" to="MovementDrag" method="drag"] -[connection signal="dropped" from="MovementDrag/Draggable" to="." method="_on_draggable_dropped"] [connection signal="dropped" from="MovementDrag/Draggable" to="MovementDrag" method="drop"] diff --git a/entities/skull.tscn b/entities/skull.tscn index d879aea..e7d68a9 100644 --- a/entities/skull.tscn +++ b/entities/skull.tscn @@ -11,7 +11,7 @@ radius = 12.0 [sub_resource type="CircleShape2D" id="CircleShape2D_1c7gd"] -radius = 24.0 +radius = 12.0 [node name="Skull" type="CharacterBody2D"] collision_layer = 8 diff --git a/entities/top_hat.tscn b/entities/top_hat.tscn index 30601a8..05bd86f 100644 --- a/entities/top_hat.tscn +++ b/entities/top_hat.tscn @@ -10,7 +10,7 @@ radius = 12.0 [sub_resource type="CircleShape2D" id="CircleShape2D_juisb"] -radius = 24.0 +radius = 12.0 [node name="TopHat" type="CharacterBody2D"] collision_layer = 8