Stop a double tap on a phone from buying or spending something twice
A fast second tap on a buy, upgrade or continue button takes the money twice or opens two windows. A simple delay is the usual answer and it causes its own bug. This entry shows how to make the AI ignore only the accidental tap and let honest fast play through.
Why this works
A second tap within a blink is almost never meant. But the answer is not to wait longer: it is to ask whether the last tap actually did something. Counting only the taps that counted lets a deliberate fast player through.
When not to use it
Do not guard buttons that should repeat fast, like a stepper or a tap-to-collect game. And an action that costs real money or cannot be undone needs more than a delay: the shop or server should accept each purchase only once.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 14 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 "Stop a double tap on a phone from buying or spending something twice" (read_entry double-tap-buys-twice) 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