Bounce effect using hitTestPoint

im building a flash car game where if u hit the sides of the buildings you bounce off
my problem is that sometimes you get stuck in the walls and it doesnt bounce at all

heres my bounce code

public function moveCar(timeDiff:Number) {

			// get current position
			var carPos:Point = new Point(,;
			// calculate change
			var carAngle:Number =;
			var carAngleRadians:Number = (carAngle/360)*(2.0*Math.PI);
			var carMove:Number = speed*timeDiff;
			var dx:Number = Math.cos(carAngleRadians)*carMove;
			var dy:Number = Math.sin(carAngleRadians)*carMove;
			// see if car is NOT on the road
			if (!gamesprite.road.hitTestPoint(carPos.x+dx+gamesprite.x, carPos.y+dy+gamesprite.y, true)) { = gamesprite.side.y; = gamesprite.side.x;
				// see if car is on the side
				//bounce off
				if (gamesprite.side.hitTestPoint(,, true)) {
					gamesprite.y =  (Math.sin( * 0.018) * speed) * 5 / -1;
					gamesprite.x = speed * Math.cos( * 0.018) * 4;
					speed = 0 - speed * bounce;
			// set new position of car = carPos.x+dx; = carPos.y+dy;

heres a copy of the game

can someone help me out plz


you may check Box2dflash library for that sort of things.

Cool game, its like a cartoonish version of GTA2, keep going :slight_smile:

thanks, i cant figure this box thing out. its really annoying me

thanks for the response