Taps on a picture shown with black bars land beside the real spot
A picture shown on screens of many shapes is usually scaled to fit, leaving empty bars, and a hit test that ignores that is off by exactly the width of the bar. This entry converts a tap into a place on the picture, sets the hit zone, and counts finds, repeats and misses.
Why this works
The picture on the screen is not the picture in your file: it is scaled and moved. Storing targets as shares of the picture and turning each tap into the same shares makes the answer right on every screen.
When not to use it
If the picture can be zoomed, panned or rotated by the player, the simple scaling no longer describes where it is. Convert taps through the actual current view each time, or lock the view while the player searches.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 44 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 "Taps on a picture shown with black bars land beside the real spot" (read_entry spot-difference-tap-on-scaled-image) 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