Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.
This repository was archived by the owner on May 5, 2026. It is now read-only.

Drag should respect nailed tiles on phone (touch device) #112

Description

@thunderrabbit

Initial attempt

Attempted in commit 90321a3 ("Block drag into out-of-bounds or occupied cells") which added a rubber-band check in GameSwipeDetector._on_GSD_drag_event: candidate cell under finger is computed via Helpers.pixels_to_slot, and the piece's pixel position only updates if the cell is in-bounds and Helpers.board[cell] == null.

However,

Dragging from left to right past a wall, the dragged piece stops correctly for a while and then "teleports" through the wall once the finger reaches the other side. The piece should remain stuck, or slide up and down with a bit of friction. (maybe we need real 2D physics)

Dragging from right to left past a wall, the dragged piece stops only once it has reached the left edge of the nailed piece but should have blocked on the nailed piece's right side edge. It then "teleports" once the drag has gone beyond the wall. (maybe we need real 2D physics)

Known/expected gaps in current implementation:

  • Only the final candidate cell is checked. A fast drag could in theory teleport across a 1-cell-tall obstacle in a single input event since the path between old and new finger pos isn't walked.

(maybe we need real 2D physics)

Future enhancement (the longer-term reason this matters): a slowly-descending barrier ("wall coming down") that the dragged piece must also respect. Conceptually a moving nailed-tile boundary — pieces can be dragged below it, not above.

Discussed 2026-05-05 as a v2 mechanic to layer on top of the basic collision once core gameplay is solid. Generalization of #25.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions