# Verlet collision detection, direction

**URL:** <https://forum.kirupa.com/t/verlet-collision-detection-direction/322700>\
**Category:** flash\
**Created:** [May 31, 2011, 10:24am UTC](https://forum.kirupa.com/t/verlet-collision-detection-direction/322700 "2011-05-31T10:24:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johaannes](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@johaannes](https://forum.kirupa.com/u/johaannes)\
**Post date:** [May 31, 2011, 10:24am UTC](https://forum.kirupa.com/t/verlet-collision-detection-direction/322700/1 "2011-05-31T10:24:11Z")

</div>

Ok so I have been doing a bunch of flash games for a while now. And it has been fun doing them with some basic physics(euler). But there comes a time when you need to step out onto deep waters. So I decided I would try to learn how to make some sort of more advanced physics engine. So I could do awesome collisions and cool ragdolls! After some googeling I found the “verlet” method.

So yesterday and today I have tried to learn how to do that. To implement the motion to a point is as easy as it was with euler. But the collision detection stuff is a bit harder(or is it??).

With euler, If I have an object, like the player, and I want him to follow the ground, I would code something like this.

```auto
while(ground.hitTestPoint(object.x,object.y, true)){
     grav = 0;
     object.y --;
}

```

But how would I do something similar to this with verlet. And how would I tell the point to which direction it should bounce?

Feel free to link to recourses that explain the solution. But I will probably already have read them and not understood. :cry3:
