# Tell if moving ball has passed through point (AS2/3/whatever)

**URL:** https://forum.kirupa.com/t/tell-if-moving-ball-has-passed-through-point-as2-3-whatever/269124
**Category:** flash
**Created:** [August 23, 2008, 12:09am UTC](https://forum.kirupa.com/t/tell-if-moving-ball-has-passed-through-point-as2-3-whatever/269124 "2008-08-23T00:09:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ShawnJC](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/shawnjc/32/747_2.png) [@ShawnJC](https://forum.kirupa.com/u/ShawnJC)
#### Post date: [August 23, 2008, 12:09am UTC](https://forum.kirupa.com/t/tell-if-moving-ball-has-passed-through-point-as2-3-whatever/269124/1 "2008-08-23T00:09:37Z")

</div>

Hello all. I’ve got a game program I’ve been working on and there is some balls bouncing around on the screen that’s velocity x and velocity y could possibly be faster than it’s width and I need to tell if it will collide with a point between one cycle of animation and the next.

For instance, below X is the ball and \* is the point.

X-----\*-----X

In the first cycle, X is to the left of the point and then next cycle X is to the right, so I’d like a forumula that somehow calculates the difference and tells me if I should have bounced off of the point instead of went through.

Like:  
If (ball passed through point) {  
//reverse velocity  
}

It’s only an X/Y point I need to figure out right now. I’ve found code that figures out ball vs ball collisions and have modified that for an X/Y point, but if the ball moves too fast it goes right through. Thanks for any help on this!
