A Flash Developer Resource Site

# Thread: Bounce =) Should be easy. Not!

1. ## Bounce =) Should be easy. Not!

ok ok

picture this

a ball bouncing around the stage
easy

now there is a wall 100 by 100 in the center of the stage
hard.
help
=)

2. i'd use getBounds to find the four edges of the square. if the ball was to the left of the left edge before it hit, then it should most likely bounce back to the right. if it was above the top edge, it should most likely bounce back up. you might have some inconsistencies if it hits close to a corner, but overall, should be ok.

3. hmmmmm
bit-101 thanx. too hard to explain ill upload an fla.

Ill upload an fla of what i mean.

ps thanx for the gravity tutorial.

4. Here it is.

the white rectangle in the middle is what i want the ball to bounce off of.

5. i understood what you meant in the first post. my answer is one way to go about it.

6. ahahah is getbounds flash mx?

Thanx dawg

7. what is target coordinate space?

8. target coord space is like a viewpoint. are you looking at the bounds from the stage coords or the movie clip coords?

for instance, 100x100 movieclip in center stage. from its coord space, its bounds are -50, +50 on x and -50, +50 on y.

from root, the bounds are something like 225, 325 on x, 150, 250 on y.

9. Im not sure how to approach this with get bounds.

Would this be in the ball movieclip?

vars = _root.MovieClip
vars.getBounds(_root.movieClip)
if (_x > vars){
}
?

I know thats not right just attempting.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap