Question

Je ne sais pas pourquoi mais je ne peux pas sembler savoir pourquoi cela ne fonctionne pas ... J'essaie de rendre quelque chose de vraiment simple, comme quelque chose qui tombe de l'écran.

Il semble que avec le dernier téléchargement et le premier exemple de code sur le site, je me trompe toujours.

J'ai ceci:

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);
        }
    }
}

Mais je comprends 2 les erreurs:

Non CreateBody() Méthode (il y a un AddBreakableBody() pourtant)

'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 Constructor prend 2 arguments (ceux-ci faciles mais toujours une erreur dans l'exemple)

'FarseerPhysics.Collision.Shapes.CircleShape' does not contain a constructor that takes 1 arguments

J'ai essayé tellement de choses et je suis confus pourquoi je peux obtenir ça. Ce code fonctionne-t-il pour les autres? Ma DLL est-elle gâchée?

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top