Hi All,
I have what I think should be a simple question on scripting. I have two images that represent a compass, one being the compass body and the other the compass needle overlaid on top. My plan is that the player will have the ability to hide/show this compass, and can switch between different named 'targets' on a field map, which would be a given event.
I am horrible at math, so was hoping if anyone could point out how to calculate the rotation needed for my needle image, given the player event's position and the target event's position? Examples:
Player is at 10,10
Target is at 10,5
...Then Needle image rotation is 0 degrees
Player is at 15, 15
Target is at 20, 10
...Then needle rotation is 45 degrees
Anyone?
I have what I think should be a simple question on scripting. I have two images that represent a compass, one being the compass body and the other the compass needle overlaid on top. My plan is that the player will have the ability to hide/show this compass, and can switch between different named 'targets' on a field map, which would be a given event.
I am horrible at math, so was hoping if anyone could point out how to calculate the rotation needed for my needle image, given the player event's position and the target event's position? Examples:
Player is at 10,10
Target is at 10,5
...Then Needle image rotation is 0 degrees
Player is at 15, 15
Target is at 20, 10
...Then needle rotation is 45 degrees
Anyone?