Glad it works. And yes it is pythagora’s a2 + b2 = c2 so it’s really not that advanced. math.pow sets it to the power of 2 so c = a2 + b2, and then I use sqrt to get the real value of C. math.abs sets the number to be always positive in case your ball is at 250 pixels and you click way to the left, lets say 50 pixels. It would be 50 - 250 = -200. math.abs just sets it to 200. Probably from being around the forums so much and reading all kinds of things, you pick up small things like this. Also this is something I implemented in a game at the beginning for learning purposes. Anyway glad it works and gl with the rest of your game [import]uid: 77199 topic_id: 36434 reply_id: 144728[/import]