Tell tap, hold, drag, pan and pinch apart on a phone strategy game
On a phone, one finger can mean select, hold for a menu, or scroll the map, and two fingers can mean zoom or move. A shaky tap becomes a drag, or a zoom moves the map as well. Here is how to classify a touch so these things do not fight each other.
Why this works
A finger never stays perfectly still, so the question is how far it wandered and for how long, not where it ended. Judging the whole touch once it is finished, with a small allowance for shaking, lets tap, hold, drag and zoom each have a clear border.
When not to use it
Not for games played with a mouse or buttons, and not for a game with a single touch use such as tap only, where the extra rules only add chances to misread. If a game needs fast, precise reactions, put on-screen buttons instead of gestures.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 20 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Tell tap, hold, drag, pan and pinch apart on a phone strategy game" (read_entry touch-tap-hold-pan-pinch) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP