Skip to content

Commit 956c5bc

Browse files
authored
sheep: Add physics and interaction (#2211)
Previously the sheep was a pure decoration. Now it has physics and you can interact with it. (It baas when you annoy it.) This reuses the pet_interaction.gd script from the cat. Sheep are just weird cats.
1 parent 4dc60d4 commit 956c5bc

5 files changed

Lines changed: 75 additions & 12 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3f8ae8c724a09652262c729196926f5dcafe260333f2b93c640e1ea077cc5cdc
3+
size 77020
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[remap]
2+
3+
importer="wav"
4+
type="AudioStreamWAV"
5+
uid="uid://dtf82j11434vb"
6+
path="res://.godot/imported/sheep_baa.wav-1f3f93fc8bf37b2f31f9f53d2f50a326.sample"
7+
8+
[deps]
9+
10+
source_file="res://scenes/game_elements/props/decoration/sheep/components/sheep_baa.wav"
11+
dest_files=["res://.godot/imported/sheep_baa.wav-1f3f93fc8bf37b2f31f9f53d2f50a326.sample"]
12+
13+
[params]
14+
15+
force/8_bit=false
16+
force/mono=false
17+
force/max_rate=false
18+
force/max_rate_hz=44100
19+
edit/trim=false
20+
edit/normalize=false
21+
edit/loop_mode=0
22+
edit/loop_begin=0
23+
edit/loop_end=-1
24+
compress/mode=2
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright: AntumDeluge / mikewest
2+
SPDX-License-Identifier: CC0-1.0
3+
4+
https://opengameart.org/content/sheep-baa

scenes/game_elements/props/decoration/sheep/sheep.tscn

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,59 @@
22

33
[ext_resource type="SpriteFrames" uid="uid://b0ba41utstkyk" path="res://scenes/game_elements/characters/components/sprite_frames/sheep.tres" id="1_hj6il"]
44
[ext_resource type="Script" uid="uid://cms2wqtbxjl1h" path="res://scenes/game_logic/sprite_behaviors/random_frame_sprite_behavior.gd" id="2_jsyxc"]
5+
[ext_resource type="Script" uid="uid://du8wfijr35r35" path="res://scenes/game_elements/props/interact_area/interact_area.gd" id="3_5wm27"]
6+
[ext_resource type="Script" uid="uid://djeshbrs3vwnb" path="res://scenes/game_elements/characters/npcs/cat/components/pet_interaction.gd" id="4_pcfmk"]
7+
[ext_resource type="AudioStream" uid="uid://dtf82j11434vb" path="res://scenes/game_elements/props/decoration/sheep/components/sheep_baa.wav" id="5_5wm27"]
58

6-
[node name="Sheep" type="Node2D" unique_id=398073521]
9+
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_hj6il"]
10+
radius = 6.0
11+
height = 37.999985
12+
13+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tsjbs"]
14+
size = Vector2(52.5, 58)
15+
16+
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_3vki4"]
17+
random_pitch = 1.15
18+
streams_count = 1
19+
stream_0/stream = ExtResource("5_5wm27")
20+
21+
[node name="Sheep" type="CharacterBody2D" unique_id=2063148848]
22+
collision_layer = 2
723

824
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1456881412]
925
unique_name_in_owner = true
1026
sprite_frames = ExtResource("1_hj6il")
1127
animation = &"idle"
1228
autoplay = "idle"
13-
offset = Vector2(0, -14)
29+
offset = Vector2(4, -14)
1430

1531
[node name="RandomFrameSpriteBehavior" type="Node2D" parent="AnimatedSprite2D" unique_id=63344388 node_paths=PackedStringArray("sprite")]
1632
script = ExtResource("2_jsyxc")
1733
sprite = NodePath("..")
1834
metadata/_custom_type_script = "uid://cms2wqtbxjl1h"
35+
36+
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2118837157]
37+
rotation = -1.5708
38+
shape = SubResource("CapsuleShape2D_hj6il")
39+
40+
[node name="InteractArea" type="Area2D" parent="." unique_id=1191867788]
41+
collision_layer = 32
42+
collision_mask = 0
43+
script = ExtResource("3_5wm27")
44+
action = "Annoy the sheep"
45+
metadata/_custom_type_script = "uid://du8wfijr35r35"
46+
47+
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea" unique_id=1330536002]
48+
visible = false
49+
position = Vector2(5, -28)
50+
shape = SubResource("RectangleShape2D_tsjbs")
51+
debug_color = Color(0.6290859, 0.52632225, 0.15803415, 0.41960785)
52+
53+
[node name="PetInteraction" type="Node" parent="." unique_id=1162035923 node_paths=PackedStringArray("interact_area", "miaow_player")]
54+
script = ExtResource("4_pcfmk")
55+
interact_area = NodePath("../InteractArea")
56+
miaow_player = NodePath("AudioStreamPlayer2D")
57+
58+
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="PetInteraction" unique_id=1930789457]
59+
stream = SubResource("AudioStreamRandomizer_3vki4")
60+
bus = &"SFX"

scenes/quests/story_quests/el_juguete_perdido/3_sequence_puzzle/sequence_puzzle.tscn

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ script = ExtResource("15_i80sc")
1919
type = 2
2020
metadata/_custom_type_script = "uid://bgmwplmj3bfls"
2121

22-
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_acxkl"]
23-
height = 42.0
24-
2522
[node name="SequencePuzzleTemplate" type="Node2D" unique_id=1912634357]
2623

2724
[node name="PlayerMode" type="Node" parent="." unique_id=2087262417]
@@ -89,13 +86,6 @@ dialogue_title = &"well_done"
8986
position = Vector2(1481, 389)
9087
scale = Vector2(-1, 1)
9188

92-
[node name="StaticBody2D" type="StaticBody2D" parent="OnTheGround/Sheep" unique_id=1499841164]
93-
collision_layer = 2
94-
95-
[node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/Sheep/StaticBody2D" unique_id=899751853]
96-
rotation = -1.5708
97-
shape = SubResource("CapsuleShape2D_acxkl")
98-
9989
[node name="Sign" parent="OnTheGround" unique_id=999258150 instance=ExtResource("17_64xko")]
10090
position = Vector2(230, 92)
10191
direction = 1

0 commit comments

Comments
 (0)