Swipes are sometimes read as taps, or go the wrong way
A finger never moves in a perfectly straight line or stays perfectly still, so a game that compares two points naively mixes up taps, swipes and diagonal slips. Here is the set of rules your AI should use to tell them apart, and which doubtful cases to simply ignore.
Why this works
A finger is never exact, so the game must judge intent from three plain facts: how far it moved, how straight, and how long it stayed. Tying the distance to the size of the tiles keeps it fair on any screen, and ignoring unclear motions costs only a retry.
When not to use it
Skip it when the player draws free shapes or drags objects around, as in a painting game or a slingshot. There the whole path matters, not one direction. Follow the finger continuously instead of sorting the motion into a few kinds.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 31 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Swipes are sometimes read as taps, or go the wrong way" (read_entry swipe-or-tap-on-a-touch-screen-gesture-rules) 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