I'm thinking of making a spot the difference game. But immediately I stumbled over a problem. I'm thinking of storing a "difference area" in the form of a x,y
coordinate. However, because on a smartphone it will be difficult selecting the exact pixel at that location, I need a way of checking if the "area" is within the "touch area". I hope that makes sense. I've attached an image to help you understand
In this example the "difference point" is located at -180,-140
. A user could touch anything within 5 pixels of that and that will be marked as a correct answer. So touching -177, -147
would also be correct. How can I check if the touch-coordinates are within a 5 pixels radius of the correct "difference point"?