Jun 7, 2012 at 4:05 PM
Edited Jun 7, 2012 at 4:06 PM
Hello everyone. There is a problem with integration farseer engine. What I did to integrate farseer into sample windows phone 7 project (shooter from XNA tutorial site):
1. I opened "Farseer Physics XNA WP7.csproj"
2. I builded it.
3. I went into folder "...\Farseer Physics Engine 3.3.1 Samples XNA\Farseer Physics Engine 3.3 XNA\bin\Windows Phone\Debug\"
4. Copied file "FarseerPhysicsXNA.dll" into folder of my project.
5. In Visual Studio (with my project opened in it) I clicked "Project -> Add Reference" and then selected file "FarseerPhysicsXNA.dll"
6. At last I clicked "Add to Reference..." in Object browser.
Is that alright with my way to add farseer into game? I ask this question because it does not work.
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
protected override void Initialize()
player = new Player();
playerMoveSpeed = 8.0f;
TouchPanel.EnabledGestures = GestureType.FreeDrag;
protected override void LoadContent()
spriteBatch = new SpriteBatch(GraphicsDevice);
world = new World(Vector2.Zero);
Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y +
GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
Vector2 _position = new Vector2(445f, 205f);
world.Gravity = new Vector2(0, 20);
_circle = new Body(world);
_circle.Position = _position;
_circle.BodyType = BodyType.Dynamic;
// Load the player resources
testText = Content.Load<Texture2D>("player");
protected override void Update(GameTime gameTime)
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
// Save the previous state of the keyboard and game pad so we can determinesingle key/button presses
previousGamePadState = currentGamePadState;
previousKeyboardState = currentKeyboardState;
// Read the current state of the keyboard and gamepad and store it
currentKeyboardState = Keyboard.GetState();
currentGamePadState = GamePad.GetState(PlayerIndex.One);
//Update the player
protected override void Draw(GameTime gameTime)
// Start drawing
// Draw the Player
spriteBatch.Draw(testText, _circle.Position, Color.White);
But body doesn't move.
Can anyone help me and say - where is the problem?