-
Senior Member
Can anyone help me with a bounceTo function?
Hello,
I'm trying to write a function which makes a movieclip bounce to a certain position.
All I've come up with is a bit of trig which moves the clip up and down while gradually shifting the 'base' y position and a straight tween on the x axis.
But it just looks like a ball going up and down along a path, and not like it bouncing into position.
Anyone got any ideas?
cheers.
-
I'm not sure what exactly you're tryna do but I can suggest you using a Tween to do the bouncing.
You can find a lot about using tweens here:
http://www.republicofcode.com/tutori...as3tweenclass/
I find tweens the most applicable and easiest way to do the jobs like this
-
Senior Member
Thanks caseyryan,
I'd completely forgotten about this thread and had figured it out already (using tweens).
I can post the code up as it's now too integrated with the rest of my code base, but it general idea is as follows.
The x axis of the movement was tweened using a straight, non-eased, tween. Then calculate how many bounces I want based on the distance of the tween, and create a separate tween for the up and down motion of each bounce. Eased in the eased out to put some pseudo gravity in there.
Then I just stitched the tweens together using a tween timeline manager.
I used the greensock Tweenlite and Timeline libraries.
Cheers,
Z.
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
|