Add snap-to-stand detection #8

Merged
scruffydude merged 1 commit from task/3-snap-to-stand into main 2026-10-01 17:48:17 -04:00
Owner

Stands get a stand.gd script (stand_id + group membership). On drop, item.gd searches the stands group for the nearest stand whose stand_id matches the item's item_id; if within snap_distance it snaps exactly onto it, marks placed = true, and plays a small scale-punch tween as a placeholder snap animation. Re-picking up a placed item clears placed. Emits placed_changed for #4 to consume.

Validated the actual matching/snap/reject logic (not just scene load) with a disposable headless SceneTree script exercising: too-far (no snap), correct distance+id (snaps exactly), and mismatched id (no snap).

Closes #3

Stands get a `stand.gd` script (`stand_id` + group membership). On drop, `item.gd` searches the `stands` group for the nearest stand whose `stand_id` matches the item's `item_id`; if within `snap_distance` it snaps exactly onto it, marks `placed = true`, and plays a small scale-punch tween as a placeholder snap animation. Re-picking up a placed item clears `placed`. Emits `placed_changed` for #4 to consume. Validated the actual matching/snap/reject logic (not just scene load) with a disposable headless SceneTree script exercising: too-far (no snap), correct distance+id (snaps exactly), and mismatched id (no snap). Closes #3
Stands get a small stand.gd script (stand_id + group membership).
Items already track an item_id (#2); on drop, item.gd now searches
the "stands" group for the nearest matching stand_id and, if within
snap_distance, snaps exactly onto it, marks itself placed, and plays
a small scale-punch tween as a placeholder "snap" animation hook.

Items re-entering a drag clear their placed state, so picking a
placed item back up and moving it away un-places it. Emits a
placed_changed signal for #4's win-condition check to listen to.

Verified the matching/snap/reject logic directly (not just scene
load) with a disposable headless SceneTree test script: distance
gating, exact snap position, and item/stand id mismatch all behave
correctly.

Closes #3

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
scruffydude/project-awry!8
No description provided.