agentsclimarketplace

Tile picking interaction

Skill 0xheycat/isometric-game-skills/skills/tile-picking-interaction

Agent-ready toolkit for isometric games: ComfyUI art pipelines, seamless terrain, sprites, grid math, Canvas2D rendering, pathfinding, and asset automation.

Install
npx -y skills add 0xheycat/isometric-game-skills --skill tile-picking-interaction

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when converting a mouse/touch position into the correct isometric tile for selection, highlighting, and placement.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

1.7 KB, as published. Nobody here has run it

Tile Picking & Interaction

Overview

Picking is screen->grid with the camera inverse applied first. This skill turns a pointer position into the exact tile under it, with a highlight and hit-test that respects camera pan/zoom.

When to Use

  • Clicking selects the wrong tile.
  • You need hover highlight or click-to-place.
  • Picking ignores camera pan/zoom.

Process

  1. Take the pointer position in screen space.
  2. Apply the inverse camera transform (see camera-pan-zoom-controls).
  3. Apply screen->grid from isometric-grid-math and round to a tile.
  4. Clamp the result to map bounds and check walkable if needed.
  5. Draw a highlight on the picked tile for feedback.
  6. On click, dispatch the tile coord to the gameplay handler.
  7. Test picking at multiple zoom levels and pan offsets.
const world = screenToWorld(pointer, cam);
const tile = worldToGrid(world, W, H); // then round

Rationalizations (Stop Lying to Yourself)

ExcuseReality
"I will skip the camera inverse"Then picking breaks the moment you pan/zoom. Always invert.
"No need to highlight"Players need feedback on what they will click. Highlight.

Red Flags - STOP if you catch yourself:

  • Picking that ignores camera pan/zoom.
  • No rounding so edge tiles mis-select.
  • No visual highlight feedback.

Verification

You are NOT done until every box is checked:

  • Picked tile is correct at any pan and zoom.
  • Hover highlight matches the actual selected tile.
  • Clicks dispatch the right grid coordinate.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.