Scale cursor sprite down when clamped to screen edge #76

Merged
cammymoop merged 1 commit from feature/cursor-scale-feedback into master 2026-03-05 11:40:06 -06:00
Collaborator

Summary

  • When the virtual cursor is past the screen boundary and the sprite is projected to the edge, the sprite now scales down logarithmically based on how far outside the virtual position is
  • Scale goes from 1.0 (on-screen) to 0.5 (at max clamp distance = screen diagonal, i.e. player at the edge aiming fully outward)
  • Log curve gives fast initial drop that flattens toward the limit, giving clear feedback without being too aggressive
  • Formula: scale = 1 - 0.5 * ln(1 + t*(e-1)) where t = excess / screen_diagonal

Test plan

  • Headless run exits clean
  • gdlint passes
  • Cursor sprite shrinks visibly when aiming near/past screen edges
  • Cursor is full size when virtual position is within the screen
  • Sprite reaches ~50% size when player is at a corner and cursor is aimed directly outward
## Summary - When the virtual cursor is past the screen boundary and the sprite is projected to the edge, the sprite now scales down logarithmically based on how far outside the virtual position is - Scale goes from 1.0 (on-screen) to 0.5 (at max clamp distance = screen diagonal, i.e. player at the edge aiming fully outward) - Log curve gives fast initial drop that flattens toward the limit, giving clear feedback without being too aggressive - Formula: `scale = 1 - 0.5 * ln(1 + t*(e-1))` where `t = excess / screen_diagonal` ## Test plan - [x] Headless run exits clean - [x] gdlint passes - [ ] Cursor sprite shrinks visibly when aiming near/past screen edges - [ ] Cursor is full size when virtual position is within the screen - [ ] Sprite reaches ~50% size when player is at a corner and cursor is aimed directly outward
When the virtual cursor position is outside screen bounds the sprite
is projected to the edge; the sprite now also scales down based on how
far past the edge the virtual position is. Uses a log curve so there
is a noticeable drop early (useful feedback) that flattens toward the
limit. Scale ranges from 1.0 (on-screen) to 0.5 (at max clamp
distance = screen diagonal, i.e. player hard against the edge aiming
fully outward).

Formula: scale = 1 - 0.5 * ln(1 + t*(e-1))  where t = excess / diagonal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cammymoop merged commit 4ad70fa9fb into master 2026-03-05 11:40:06 -06:00
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
cammymoop/semi-vibed-game!76
No description provided.