fix: add pointer drag input for mobile Nadion movement#11
Closed
penta2himajin wants to merge 3 commits into
Closed
fix: add pointer drag input for mobile Nadion movement#11penta2himajin wants to merge 3 commits into
penta2himajin wants to merge 3 commits into
Conversation
On mobile devices, the player had no way to move the Nadion horizontally since movement relied solely on keyboard input. Add pointerdown/pointermove/pointerup handlers that track drag delta and update playerX accordingly. https://claude.ai/code/session_01E3YmRJq8E9Exez929AjQH3
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
solidion | 5f39573 | Commit Preview URL Branch Preview URL |
Mar 24 2026, 04:10 PM |
Replace the drag-state-based approach with the simpler breakout pattern: on pointermove, if pointer.isDown, set playerX directly to pointer.x. The previous approach failed because pointerDragging was never set to true when the game-start tap returned early. https://claude.ai/code/session_01E3YmRJq8E9Exez929AjQH3
Instead of snapping directly to pointer position, set a touch target on pointerdown/pointermove and move toward it at PLAYER_SPEED (300 px/s) in the game loop — same speed as keyboard input. Pointer up clears the target. Tap also fires. https://claude.ai/code/session_01E3YmRJq8E9Exez929AjQH3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pointerdown/pointermove/pointeruphandlers that track drag delta and updateplayerXaccordinglyTest plan
https://claude.ai/code/session_01E3YmRJq8E9Exez929AjQH3