Search tutorials
Make an MC of a ball and a platform. Call the platform's instance "floor". Apply this code to the ball MC:
onClipEvent(load){
velocity = 0
gravity = 2
friction = 0.01
}
onClipEvent(enterFrame){
velocity += gravity
velocity -= friction*velocity
_y += velocity
if(_y>_root.floor._y){
_y = _root.floor._y
velocity *= -0.9
}
}
(Make sure you place the ball over the platform because it is the platform which makes it bounce)
Thanx to a_slosh for sorting the code out for me!
| » Level Intermediate |
|
Added: 2004-10-02 Rating: 6.85 Votes: 39 |
| » Author |
| I am pretty good at flash saying that I have taught myself just about everything I know |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!