We need to add some more lines to the birdRelease
function:
private function birdRelease(e:MouseEvent):void { var distanceX:Number=theBird.x-slingX; var distanceY:Number=theBird.y-slingY; var velocityX:Number=distanceX*-1/5; var velocityY:Number=distanceY*-1/5; var birdVelocity:b2Vec2=new b2Vec2(velocityX,velocityY); var sphereX:Number=theBird.x/worldScale; var sphereY:Number=theBird.y/worldScale; var r:Number = 15/worldScale; var bodyDef:b2BodyDef=new b2BodyDef(); bodyDef.position.Set(sphereX,sphereY); bodyDef.type=b2Body.b2_dynamicBody; var circleShape:b2CircleShape=new b2CircleShape(r); var fixtureDef:b2FixtureDef=new b2FixtureDef(); fixtureDef.shape=circleShape; fixtureDef.density=4; fixtureDef.restitution=0.4; fixtureDef.friction=0.5; var physicsBird:b2Body=world.CreateBody(bodyDef); physicsBird.CreateFixture(fixtureDef); physicsBird.SetLinearVelocity(birdVelocity); removeChild(theBird); stage.removeEventListener(MouseEvent...