我不知道为什么,但我似乎无法找出为什么这不起作用......我正在尝试做一些非常简单的事情,比如刚刚从屏幕上掉下来的东西。
似乎最新的下载和网站上的第一个示例代码,我还是错了。
我有这个:
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections;
using Microsoft.Xna.Framework.Input;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Collision.Shapes;
namespace Cross {
public class Game1 : Microsoft.Xna.Framework.Game {
GraphicsDeviceManager graphics;
public Game1() {
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.IsFullScreen = false;
graphics.PreferredBackBufferHeight = 600;
graphics.PreferredBackBufferWidth = 1200;
this.Window.Title = "Game";
}
protected override void Initialize() {
World world = new World(Vector2.Zero);
Body myBody = world.CreateBody();
myBody.BodyType = BodyType.Dynamic;
CircleShape circleShape = new CircleShape(0.5f);
Fixture fixture = myBody.CreateFixture(circleShape);
base.Initialize();
}
protected override void LoadContent() {
}
protected override void UnloadContent() {
}
protected override void Update(GameTime gameTime) {
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime) {
base.Draw(gameTime);
}
}
}
但我得到2个错误:
没有CreateBody()
方法(AddBreakableBody()
虽然有)
'FarseerPhysics.Dynamics.World' does not contain a definition for 'CreateBody' and no extension method 'CreateBody' accepting a first argument of type 'FarseerPhysics.Dynamics.World' could be found (are you missing a using directive or an assembly reference?)
CircleShape 构造函数接受 2 个参数(这很简单,但在示例中仍然出错)
'FarseerPhysics.Collision.Shapes.CircleShape' does not contain a constructor that takes 1 arguments
我已经尝试了很多东西,我很困惑为什么我能得到这个。此代码对其他人有用吗?我的dll错了吗?