-
Help with simplifying code
Hello, I have made a AS 2.0 script that allows an object to ease into rotation. Here is the code:
Code:
_root.onEnterFrame = function(){
rot = Math.atan2(_ymouse-arrow._y,_xmouse-arrow._x)*180/Math.PI;
if(arrow._rotation-rot>180){
rot += 360
}
if(arrow._rotation-rot<-180){
rot -= 360
}
arrow._rotation += (rot-arrow._rotation)/3;
}
Is this the best way to write it, or is there something more simple that I can do?
-
Senior Member
Go to tweenmax.com - download tweenmax for as2.
Much simpler, many options, easy to use.
-
Thats not really what I am looking for. I have created my own program that makes arrays of rotations. I then copy those arrays into my game, and I can reference to them and dynamically combine them into poses and animations for my characters. All I need to know is if there is a better way to write my easing code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|