Enable item-to-item collision #19

Merged
scruffydude merged 1 commit from task/18-item-collision into main 2026-10-02 12:44:29 -04:00
Owner

Widens every item's collision_mask from 1 (floor only) to 3 (floor + items) so dropped items physically bump/push apart instead of clipping through each other. No script changes - all items already share collision_layer=2, so Godot's standard RigidBody2D contact resolution handles the rest once masks match.

Verified headlessly: two items forced to an identical overlapping start position end up pushed ~40px apart after settling (proving the collision actually resolves, not just flipping a flag). Full #14 (gravity/settle) and #16 (9-item snap/win) regression suites still pass unchanged.

Closes #18

Widens every item's `collision_mask` from `1` (floor only) to `3` (floor + items) so dropped items physically bump/push apart instead of clipping through each other. No script changes - all items already share `collision_layer=2`, so Godot's standard RigidBody2D contact resolution handles the rest once masks match. Verified headlessly: two items forced to an identical overlapping start position end up pushed ~40px apart after settling (proving the collision actually resolves, not just flipping a flag). Full #14 (gravity/settle) and #16 (9-item snap/win) regression suites still pass unchanged. Closes #18
Items previously only collided with the floor (collision_mask=1) -
they could freely overlap/pass through each other. Widened every
item's collision_mask to 3 (floor layer 1 + items layer 2, bitwise
OR) so dropped items now physically bump and push apart instead of
clipping through one another.

No script changes - all 9 items already share collision_layer=2, so
once each item's mask includes that layer, Godot's standard
RigidBody2D contact resolution handles the rest. The existing
bounce_material (bounce 0.3, friction 0.6) already applies to
item-item contacts too since it's shared across all items.

Verified headlessly:
- Two items forced to an identical overlapping start position end up
  pushed ~40px apart after settling, both still resting correctly on
  the floor - confirms the new collision pairing actually resolves
  contacts rather than just enabling the flag with no effect.
- Full regression: #14's gravity/settle behavior (no NaN, no
  instability) and #16's 9-item snap matching + win-at-9/9-only logic
  both still pass unchanged with the wider mask.

Closes #18

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!19
No description provided.