Kain Nobel
Member
G'day mates!
I've been sitting on this idea for awhile, so before we get started I'm going to tell you the concept behind the question, so you can get a better understanding of what I'm trying to accomplish. BTW, I chose to post this in General Support rather than Script Support due to the question being more of a math question than a script question.
[spoiler='Mock Up' screen]I know, the cannon isn't pointing at the Mouse cursor... lame :P
[/spoiler]
With all that out of the way, I need an accurate math formula that I can implement into the Mouse script, to generate distance X/Y (by pixels) to a 0..360 degree angle, which will be used to rotate the cannon picture (and probably other systems related or not related to the 'concept'.) Screen resolution and tile coordinates need not to be calculated in this forumula, just strictly the distance between Mouse <=> Object
Thank you for anyone who can help me, I'll definately credit you in the Mouse system and the game for your efforts.
I've been sitting on this idea for awhile, so before we get started I'm going to tell you the concept behind the question, so you can get a better understanding of what I'm trying to accomplish. BTW, I chose to post this in General Support rather than Script Support due to the question being more of a math question than a script question.
Basically, in my project, you're going to be escaping a missile silo that you just inflitrated and shut down. Apon escape, you'll be stumbling upon either a boat and/or a helicopter that you can use for transporting you away from the scene. Enemy fleets will be persuing you on your escape, so you'll be manning a heavy artillery cannon which can rotate 360 degrees, this cannon will be guided with your mouse. Most likely, you'll be able to control the vehicle's movement with your arrow keys, so thats why the mouse is used to aim the cannon.
With all that out of the way, I need an accurate math formula that I can implement into the Mouse script, to generate distance X/Y (by pixels) to a 0..360 degree angle, which will be used to rotate the cannon picture (and probably other systems related or not related to the 'concept'.) Screen resolution and tile coordinates need not to be calculated in this forumula, just strictly the distance between Mouse <=> Object
Thank you for anyone who can help me, I'll definately credit you in the Mouse system and the game for your efforts.