feat(s7/d1): spider priority right-click input + visual indicator#153
Conversation
Right-clicking within the spider's 3×3 tile footprint now dispatches MarkSpiderPriority (toggle), suppressing entrance preview and rally-clear. White border drawn around spider sprite when priority is active. 6 new unit tests covering toggle, box edges, suppression, and no-spider fallthrough. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use FP_SHIFT (>>) instead of Math.floor(/FP_ONE) for tile conversion, consistent with spider.ts and the rest of the sim codebase - Clear pendingEntranceTileX/Y when spider priority toggle fires, preventing a stale entrance preview from being confirmed by a subsequent left-click - Offset priority indicator 2px outward from the sprite bounding box so it remains visible alongside the hunger ring (which occupies the same pixels) - Add test covering stale-entrance-preview clearing behavior Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5decad2937
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The 48px sprite is centered at the tile's left-edge pixel (Phaser default origin 0.5,0.5 + posX*TILE_SIZE_PX/FP_ONE = tile left edge). This puts the sprite 24px (1.5 tiles) left of the tile anchor, covering tiles [t-2, t+1] in each axis. The previous [t-1, t+1] box missed the leftmost 8px of the sprite. Expand hit range and add two tests documenting the corrected bounds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dee2697220
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ent lag SPIDER_SPEED = FP_ONE (1 tile/tick). During the first half of any movement tick the renderer shows the sprite at the previous tile position (alpha < 0.5), putting the trailing edge 1 tile beyond what a [t-2, t+1] box covers. Expand to [t-3, t+2] to reliably hit all visible sprite pixels in any movement state. Two existing corner tests updated to the new bounds; descriptions clarified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 582a59ebd8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…wn limit The [t-3, t+2] expansion to cover render interpolation lag made the hit box intercept empty-tile clicks 2 tiles outside the visible sprite, breaking rally-clear and entrance-preview for tiles near the spider (Codex P2). Keep [t-2, t+1] which correctly covers the static 48px sprite (anchor at tile left-edge pixel). The trailing-edge mismatch during movement is accepted as a programmer-art limitation at SPIDER_SPEED=FP_ONE; noted in comment. Replace the t-3 dispatch test with one verifying t-3 falls through correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ab02f3e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace tile-boundary hit detection with exact pixel-space bounds check: screenX/Y is compared against the 48×48px sprite centered at (posX >> FP_SHIFT) * TILE_SIZE_PX offset by the camera's left/top tile, matching drawSurfaceEntities exactly. Eliminates the outer half-tile dead zone at the sprite edges that the tile-range approach allowed. Tests updated to use precomputed SPIDER_SCR_X/Y constants with HALF_W/H offsets and verify the inclusive left edge, last inside pixel, and one pixel outside both edges. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ea9a96000
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… P5) The spider moves 1 tile/tick and the renderer interpolates its visual position between prev and curr. Without compensation the hit-test anchor (current-tick integer tile) can be up to one tile ahead of what the player sees. Expand the hit box by TILE_SIZE_PX (16px) symmetrically so clicks on the trailing edge after a tick still register. Test suite extended with X/Y boundary cases for both inner and outer edges of the expanded 80×80px hit region. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e93b1f1a6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace the symmetric +TILE_SIZE_PX expansion (which caused false positives when the spider was stationary or moving away from the click) with a union of the current-tick and previous-tick bounding boxes. - When prevWorld is null (stationary), the hit box is exactly the 48×48px sprite — no false positives. - When the spider moved, the box expands by one tile only in the movement direction — covering the trailing visual edge precisely. Thread prevWorld into handleSurfaceRightClick via a new optional 7th parameter (PLAYER_COLONY_ID stays 6th so existing callers are unchanged). registerSurfaceInput gains an optional getPrevWorld callback; game-scene supplies it from this.prevState (already maintained for render interp). Tests extended with two moving-spider union-box cases. Note: >> FP_SHIFT is equivalent to / FP_ONE here because the spider always moves exactly FP_ONE per tick and spawns at lairTileX << FP_SHIFT, so posX is always a multiple of FP_ONE. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
MarkSpiderPriority, toggling the sim-side priority flag that routes fighters toward the spider. Suppresses entrance-preview and rally-clear on that click.>> FP_SHIFTfor tile conversion, consistent withspider.tsand the rest of the sim.spiderPriorityColonyId,MarkSpiderPrioritycommand, tick handler) was already in place from S3.Known limitation
The priority border is drawn on the sprite and is invisible when the spider is off-screen (panned away). The stage doc explicitly defers visual polish ("programmer-art; iterate at ship time") — adding persistent off-screen HUD feedback is out of scope for D1.
Test plan
🤖 Generated with Claude Code