Hi, I have this problem that I’ve been trying to fix for a long time and I just can’t understand what’s going on.
I have these boxes bouncing around together within a boundary but when they bounce off each other they seem to shudder together for a while instead of bouncing off cleanly.
It basically comes down to this bit of code:
this.onEnterFrame = function() {
_x += (targetx-_x)/speed;
_y += (targety-_y)/speed;
//check for collsions
if ((this.hitTest(this._parent.box2.button)) || (this.hitTest(this._parent.box3.button)) || (this.hitTest(this._parent.box4.button)) || (this.hitTest(this._parent.box5.button)) || (this.hitTest(this._parent.box6.button)) || (this.hitTest(this._parent.box7.button)) || (this.hitTest(this._parent.box8.button)) || (this.hitTest(this._parent.box9.button)) || (this.hitTest(this._parent.box10.button))|| (this.hitTest(this._parent.box11.button))) {
speed = -speed;
}
Can anyone out there figure out why this hitTest thing makes them get stuck on top of each other from time to time?
Please help.
Thanks
Pete