Skip to content

cat, sheep: Fix meow/baa position - #2730

Merged
manuq merged 1 commit into
mainfrom
wjt/cat-sheep-fix-meow-baa-position
Aug 18, 2026
Merged

cat, sheep: Fix meow/baa position#2730
manuq merged 1 commit into
mainfrom
wjt/cat-sheep-fix-meow-baa-position

Conversation

@wjt

@wjt wjt commented Aug 18, 2026

Copy link
Copy Markdown
Member

Previously the AudioStreamPlayer2D was a child of a Node (not
Node2D). Nodes do not have a position in the 2D scene, so the
resulting position of the AudioStreamPlayer2D was (0, 0). The
AudioStreamPlayer2D is set to attenuate over 2000px of distance so if
the cat/sheep was more than 2000px from the (0, 0) position of the
scene, its sound would be completely inaudible, and before that it would
be quieter. We never noticed this before because the sheep and cat
happen to be close to the origin of the scene! However it was noticeable
on the new enemy interaction island in Dev Archipelago.

Change the structure of each scene so that the AudioStreamPlayer2D node
is not a child of the PetInteraction (Node) but of the root (subclass of
Node2D).

Previously the AudioStreamPlayer2D was a child of a `Node` (not
`Node2D`). `Node`s do not have a position in the 2D scene, so the
resulting position of the AudioStreamPlayer2D was (0, 0). The
AudioStreamPlayer2D is set to attenuate over 2000px of distance so if
the cat/sheep was more than 2000px from the (0, 0) position of the
scene, its sound would be completely inaudible, and before that it would
be quieter. We never noticed this before because the sheep and cat
happen to be close to the origin of the scene! However it was noticeable
on the new enemy interaction island in Dev Archipelago.

Change the structure of each scene so that the AudioStreamPlayer2D node
is not a child of the PetInteraction (Node) but of the root (subclass of
Node2D).
@wjt
wjt requested a review from a team as a code owner August 18, 2026 10:16
@wjt
wjt requested a review from felixwalberg August 18, 2026 10:16
@wjt

wjt commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

@felixwalberg this fixes the silent sheep you added in #2706

@github-actions

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/cat-sheep-fix-meow-baa-position/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq manuq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good finding! The alternative would be to make PetInteraction a Node2D, but this is better, I think.

position = Vector2(5, -28)
shape = SubResource("RectangleShape2D_tsjbs")
debug_color = Color(0.6290859, 0.52632225, 0.15803415, 0.41960785)
debug_color = Color(0.6, 0.545, 0, 0.42)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another missing one!

@felixwalberg felixwalberg Aug 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my latest PR it had automatically changed to this newer color, but I didn't realize it was intentional, so I reverted it.

@manuq
manuq merged commit 5f2ff77 into main Aug 18, 2026
7 checks passed
@manuq
manuq deleted the wjt/cat-sheep-fix-meow-baa-position branch August 18, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants