Issue with working out distance between player position and mouse position.

Hi guys,

I am using the following to work out the distance between player position and mouse position.

sqrt((pow(( game.Mouse.Position.X - self.Position.X ), 2))+ (pow(( game.Mouse.Position.Y - self.Position.Y ),2)))

However, I have notice that as the player moves to the other side of the scene (two screen lengths) the resulting distance is also increased when relatively the positions are the same. So I have come to the conclusion that player position is relative to the scene while mouse position is relative to the screen (maybe this an incorrect assumption that needs to be corrected)

Therefore, is there anyway to work out the player position relative to the screen?

Kind regards,
Guardian

Comments

Sign In or Register to comment.