Im trying to make a program that when I click the screen it tell me if I am farther or closer to the desired point from my last click. Unfortunately I don't have the code on hand, but this is the important part.
Remember I am rather new at this, don't throw anything huge at me.
mice is the click cordinates and secret is the hidden point
lastX=nowX
lastY=nowY
nowX=secretX-mouseX
nowY=secretY-mouseY
then I have an if statement to make the nows positive
This was the key part that I need help with, what I currently have
if (nowX<=lastX)
{
if (nowY<=lastY)
message="Hotter";
else
message="Colder";
}
else
message="Colder";
It works OVERALL, but it has some bugs dealing with if you get closer move so on one axis, but move away tiny bit on the other, then it shows it as colder.
Im this close to using the Pythagorean theorem.






Reply With Quote


