# Random movement help

**URL:** <https://forum.kirupa.com/t/random-movement-help/11741>\
**Category:** Uncategorized\
**Created:** [January 21, 2003, 6:48pm UTC](https://forum.kirupa.com/t/random-movement-help/11741 "2003-01-21T18:48:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dryst](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@Dryst](https://forum.kirupa.com/u/Dryst)\
**Post date:** [January 21, 2003, 6:48pm UTC](https://forum.kirupa.com/t/random-movement-help/11741/1 "2003-01-21T18:48:34Z")

</div>

I would like to create something along the lines of the random movement tutorial, but instead of the object stopping randomly and moving randomly, I want them to bounce off the walls and continue in the bounced direction, would anyone know where I can learn to do this?

thanks alot

-dryst

---

<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:** [January 21, 2003, 11:27pm UTC](https://forum.kirupa.com/t/random-movement-help/11741/2 "2003-01-21T23:27:11Z")

</div>

Check the gravity tutorial for the bouncing. Then all you have to do is create a clip and give it a random speed on both axis, check the wall collisions, and you’re done 🙂

---

<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:** [January 22, 2003, 8:13am UTC](https://forum.kirupa.com/t/random-movement-help/11741/3 "2003-01-22T08:13:22Z")

</div>

Okay, I’m new at this flash thing too, but I think I figured out a way to do what you want - check it out! Here’s the .fla

It’s basically a movieClip with formulas telling it to change direction whenever it reaches a certain point at the end of the perimiter of your stage (minus the space between the center of the movieClip and the edge of the movieClip).

Email me with questions. Pom’s idea’s great, too. It all depends on what you want to do.
