# Collision and gravity...how?

**URL:** https://forum.kirupa.com/t/collision-and-gravity-how/163181
**Category:** Uncategorized
**Created:** [September 20, 2005, 2:38pm UTC](https://forum.kirupa.com/t/collision-and-gravity-how/163181 "2005-09-20T14:38:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mrdogcat](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mrdogcat](https://forum.kirupa.com/u/mrdogcat)
#### Post date: [September 20, 2005, 2:38pm UTC](https://forum.kirupa.com/t/collision-and-gravity-how/163181/1 "2005-09-20T14:38:08Z")

</div>

Hi I need a hand with an effect I’m trying to create.

Basically what I need to produce is a box full of marbles. Imagine the box starting to swell as though more marbles are being added or as though they are growing. Eventually the corner snaps/breaks open and all the marbles start to fall out, filling another box below the break.

Now how would I do that?

I’m guessing I would need to create a collision detection and a gravity engine.

Can someone give me some code to set me off in the right direction or maybe point me towards an FLA I can download?

Thanks for your help.
