# AS3 Gravity Collisions

**URL:** https://forum.kirupa.com/t/as3-gravity-collisions/329194
**Category:** flash
**Created:** [July 30, 2012, 7:25pm UTC](https://forum.kirupa.com/t/as3-gravity-collisions/329194 "2012-07-30T19:25:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rewrew333](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rewrew333](https://forum.kirupa.com/u/rewrew333)
#### Post date: [July 30, 2012, 7:25pm UTC](https://forum.kirupa.com/t/as3-gravity-collisions/329194/1 "2012-07-30T19:25:20Z")

</div>

I am trying to simulate gravity on an object, and there are many helpful tutorials on this site but I am at a loss as to how to handle collisions with stationary platforms.

Lets say you have a block and it is falling, when it hits the platform it will stop - good  
However When its hits the edge of the platform (and greater than 50% is over the edge) it should spin out and keep falling. This is not the case if you do it the way I currently am with a simple i++ gravity

```auto
ME.y += 2; 

```

and a simple hittest

```auto
if (ME.hitTestObject(MovieClip(walls))){
       ME.y -= 2;
}

```

So my question is - how does one make more acurate gravity collisions?
