# Bouncing balls

**URL:** https://forum.kirupa.com/t/bouncing-balls/45236
**Category:** Uncategorized
**Created:** [March 12, 2004, 5:46am UTC](https://forum.kirupa.com/t/bouncing-balls/45236 "2004-03-12T05:46:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tulika](https://avatars.discourse-cdn.com/v4/letter/t/a9adbd/32.png) [@tulika](https://forum.kirupa.com/u/tulika)
#### Post date: [March 12, 2004, 5:46am UTC](https://forum.kirupa.com/t/bouncing-balls/45236/1 "2004-03-12T05:46:49Z")

</div>

how can i make the ball bounce indepently in any direction then on hitting another object in tht movie it should change it course accordingly.i have done it with two blocks placed either sides but the ball keeps moving in a staight line .  
Suppose if i place blocks on all the sides how can i make it move in all the directions instead of just one.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 13, 2004, 3:27am UTC](https://forum.kirupa.com/t/bouncing-balls/45236/2 "2004-03-13T03:27:02Z")

</div>

here you go, from action scrips… [http://www.actionscript.org/tutorials/advanced/circle\_collisions/index.shtml](http://www.actionscript.org/tutorials/advanced/circle_collisions/index.shtml) good luck hope this is what u ment.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 13, 2004, 5:26am UTC](https://forum.kirupa.com/t/bouncing-balls/45236/3 "2004-03-13T05:26:49Z")

</div>

thanks for the code this is the action i required but there r few things i couldn’t undestand, if u could help.  
The walls around r giving hitTest but they r not moviclips in the original .fla i have downloaded. Although the movie is running fine.So How is it possible?  
Please if u can explain the AS added to the circle it will be a great help.  
Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 13, 2004, 4:23pm UTC](https://forum.kirupa.com/t/bouncing-balls/45236/4 "2004-03-13T16:23:03Z")

</div>

this is the wonders of actionscripting, in the code you will c a bunch of \_y \_ x characters this is telling flash where and why the balls with bouce accordingly, the .random code tells the ball to go wherever it wants on the stage, there are sin. cos. and ten. that also can tell your objects different ways to move, I.E. the falling snow tutorial, if you edit the .random the snow wont flow as it does it will fall straight or to the left/right, hope this helps but i have to run, Bye

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 13, 2004, 5:15pm UTC](https://forum.kirupa.com/t/bouncing-balls/45236/5 "2004-03-13T17:15:34Z")

</div>

\*tan

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 15, 2004, 5:28am UTC](https://forum.kirupa.com/t/bouncing-balls/45236/6 "2004-03-15T05:28:22Z")

</div>

Thanks for ur effort but why aren’t the walls movie clips unless they are MC’s how can the hitTest be true.  
Please explain.
