Hi, I'm trying to work out how to calculate the direction to a point on the screen. Anyone know how to do this? I'm guessing it's something using sin but I have no idea what :s
Note: Trying to avoid using a new sprite and having it go somewhere to be pointed at
Last edited by Smozzick (2012-03-02 12:42:16)
Offline
atan2...Wikipedia will be your friend here.
Offline
Yes...but it requires some trig...actually, I have a tutorial on this.
Offline
Thanks for all of these; they were very useful and I might go over that trig tutorial sometime to check if there's anything else I don't know from it. I'm already fine with pendulum motions, oscillation and such so this was the last main obvious thing.
Pity the codes so long <.<
Offline
Smozzick wrote:
Thanks for all of these; they were very useful and I might go over that trig tutorial sometime to check if there's anything else I don't know from it. I'm already fine with pendulum motions, oscillation and such so this was the last main obvious thing.
Pity the codes so long <.<
There's actually an obsolete block for this--I know it will work downloaded, maybe in Java, but not in Flash.
Last edited by Greenatic (2012-03-03 18:32:43)
Offline
Greenatic wrote:
There's a actually an obsolete block for this--I know it will work downloaded, maybe in Java, but not in Flash.
Huh, that's cool; though I try to avoid using those to stop people form having to download the project.
Offline
Easiest solution:
Make an invisible sprite at those coordinates. Make the shown sprite face the invisible one! Voila.
Offline