Best way to hitTest particles?

I’ve set up a small mostly AS 2.0 particle engine, its pretty neat. My one problem is this: I want to make them hitTest walls/floors. I can do the actual hitTests just fine, the problem is that at a low velocity they just get stuck within the walls/floor, and just fall through slowly. Is there any good way avoid this?

Note: I am essentially remaking the engine in my signature in AS 2.0.

I’m not very experienced with using particles and physics etc in Flash but I think you have to calculate the friction of the walls and floor etc.

There’s a tutorial on this at actionscript.org at:
http://www.actionscript.org/tutorials/intermediate/Flash_Physics_Study/index.shtml

Hopefully this’ll help you out,
Dave

Hmm… that looks interesting. I’m not sure if its the friction that does it, but it seems to have some method of making sure it bounces.

Yes, that may happen when the intersecting regions of the object and wall/floor is greater than the object’s current velocity.

To get around that problem I normally use if else statements rather than hitTest, or you should check if the ibject will collide the wall before assigning it’s new position. Do you see where I’m getting at?

Pretty much… like:

if(!wall.hitTest(particle._x+particle.xVel, particle._y+particle.yVel, true)){
move particle
} else {
bounce particle
}