Upgrading from < 3.0 version issue

May 1, 2011 at 3:35 PM

I am trying to get the following article to use the 3.0 version of the engine.

http://dotnetslackers.com/articles/silverlight/Write-an-Online-Basketball-Shooting-Game-Using-Silverlight-4-and-Farseer-Engine-part2.aspx

I am doing this with extremely limited knowledge of the original game and of farseer and the physicshelper.  if i get lucky, happy to share with everyone the new code.  I think the article is an excellent one!

I am down to couple errors:

  1. Error 3 'FarseerPhysics.Dynamics.Body' does not contain a definition for 
    1. 'ClearForce' and no extension method 'ClearForce' accepting a first argument of type 'FarseerPhysics.Dynamics.Body' could be found (are you missing a using directive or an assembly reference?) 
    2.  'ClearImpulse'
    3.  'ClearTorque' 
  2. Error 2 No overload for '_physicsController_Collision' matches delegate 'Spritehand.FarseerHelper.PhysicsControllerMain.CollisionHandler'

_physicsController.Collision += new PhysicsControllerMain.CollisionHandler(_physicsController_Collision)

Any help would be appreciated.  

Thanks!

Dan Hickman

May 1, 2011 at 8:28 PM

i think i have a workaround for #2.  Still working #1.

I see "ApplyForce" as a method.  perhaps i should replacae ClearForce with ApplyForce?  if so, what should i pass in?

Coordinator
May 11, 2011 at 4:01 PM


You can try LinearVelocity and AngularVelocity: 

sprite.Value.BodyObject.LinearVelocity = xna.Vector2.Zero;
sprite.Value.BodyObject.AngularVelocity = 0;