Is there an alternative to Math.asin() in HaxeFlixel?

24 views
Skip to first unread message

Moshe Adriano Yosef Feit

unread,
Jan 27, 2016, 4:55:44 PM1/27/16
to HaxeFlixel
Hi,

I'm trying to make a tower defense game with HaxeFlixel. I got this problem. I'm trying to find a way to rotate player, to face directly to the enemy.

I've been doing it manually, using pythagorean, and then find the degree of the triangle (alpha). So player will rotate α degree and it'll facing the enemy.

Suppose I got sine α = 0.2, to find α, it is asine(0.2), right? But when I used Math.asine(0.2), it always return with the same (close to) number, 0.2. Not the degree which I needed to find.


Am I doing it right? Is there an easier way to do this? Or maybe any other suggestions?


Thanks for your help.

Moshe Adriano Yosef Feit

unread,
Jan 27, 2016, 6:30:16 PM1/27/16
to HaxeFlixel
Nevermind, didnt read it is returned Radians.

Sorry

Jeru Sanders

unread,
Jan 28, 2016, 2:03:42 PM1/28/16
to HaxeFlixel
You can also use functions from FlxAngle.
Reply all
Reply to author
Forward
0 new messages