OZONE Asylum
Forums
Multimedia/Animation
Wheee!
This page's ID:
11227
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Finally got this tiny little project "basically" workin as it should... [url=http://www.krets.net/misc/freakmebaby.html]http://www.krets.net/misc/freakmebaby.html[/url] Any suggestions on how to make the motion more realistic and no so choppy.... Basically right now the X and Y components of the velocity are parsed from the user input (vel) and angle (angl) and then calculated with.... velY = Math.sin(angl)*vel; velX = Math.cos(angl)*vel; moveY = -velY*t + .5*a*t*t; Then I use an if statement for position followed by... (go is the instance name of the square movie clip) go._x += velX; go._y += moveY; What would be a way to smooth out the animation without using that targetX - go._x technique which slows it down as it nears the target? Man, this shit is so much fun. Thanks to everyone (especially Steve) who has helped me out! Here's the full code on the clip responsible for the movie... gravity, theta, and formVel are all set by the user in the form. t is set in the first frame of my actions layer to be equal to 1. Figured that might be the easiest way to take care of the time interval... [code] a = parseInt(gravity); crappyangle = parseInt(theta); angl = (Math.PI*crappyangle)/180; vel = parseInt(formVel); velY = Math.sin(angl)*vel; velX = Math.cos(angl)*vel; moveY = -velY*t + .5*a*t*t; if (go._y < 485) { go._x += velX; go._y += moveY; t++; } else { stop(); } [/code] [url=http://www.krets.net] [img]http://www.krets.net/sigs/smallkrets.gif[/img] [/url] [This message has been edited by kretsminky (edited 09-26-2001).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »