While using mouse aiming in a top-down 360-degree shooter, say the player is a tank, is it possible to have the turret aim using the mouse, but track slower?
Ie the player moves the moves quickly acorss teh screen, but it takes teh turret of teh tank a few seconds to catch up.
Don't knock on death's door- ring the doorbell and run away. He hates that.
Surely that'll get messed up when value A is 350 and value B is 5, for example? It'll think it has to turn 345 degrees one way, when in reality it only needs to go 15 degrees in the other direction.
It won't work properly all the time if you do that (like if the direction you want is 10 degrees and the current direction is 350). You need to get the two directions within half a full rotation of each other. You can do that by fixing one angle at 180 degrees (add the difference between 180 and the first angle to the second angle) then making sure the remaining angle is within 360 and 0 (add 360 and then mod by 360). In MMF that's something like:
(Angle2+540-Angle1) mod 360
(Which you then compare to 180.) Alternatively you could use an extension (I think the Angle Calculator can do it).
Obviously that was an off-the-cuff example, it would only take a couple more triggers to work in full 360, but I was actually thinking of a side-view turret that wouldn't be able to rotate a full 360 and therefore wouldn't have to go through itself.
ok well, i'm not totally sure about that radix, you may be right, but i'm jsut saying, it's better safe than sorry, am i right? either way, whatever works for you is fine, as long as you are satisfied with it
that's awesome! thx for your comment on that radix, that's exactly why i don't come to these forums much, like, i don't mind spammers to a degree, but being just plain rude is worse than crap
Thanks for the quick replies, I'll test that out and see how it works for me.
And Radix, While I most certainly appreciate your input, is it really all that neccessary to belittle people like that ? C'mon, I'm sure you can be a little more mature than that.
Edited by the Author.
Don't knock on death's door- ring the doorbell and run away. He hates that.