Ejemplo n.º 1
0
 public static void Main(string[] args)
 {
     using (Engine engine = new Engine(typeof(MainMenuGameState)))
     {
         engine.Run();
     }
 }
Ejemplo n.º 2
0
 public PausedGameState(Engine engine)
     : base(engine)
 {
 }
Ejemplo n.º 3
0
 public MainMenuGameState(Engine engine)
     : base(engine)
 {
 }
Ejemplo n.º 4
0
        public void Initialize(Engine engine)
        {
            this.engine = engine;

            this.CreatePlayer();

            /*
            var r = new Random();
            for (int i = 0; i < 100; i++)
            {
                var node = new SceneNode();
                var box = new PhysicsObject(
                    "Sphere",
                    new Vector3(r.Next(20) - 10, r.Next(500) + 200, r.Next(20) - 10),
                    Quaternion.Identity,
                    Vector3.One,
                    typeof(SphereShape),
                    false);
                node.AttachEntity(box);
                this.AttachSceneNodeToRoot(node);
            }
            */

            this.sceneGraph.Initialize(this.engine);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes the scene graph.
        /// </summary>
        /// <param name="engine">The engine.</param>
        public void Initialize(Engine engine)
        {
            this.engine = engine;

            foreach (var entity in this.root.Entities)
            {
                entity.LoadContent(this.engine);

                if (entity.GetType() == typeof(PhysicsObject))
                {
                    var physicsObject = (PhysicsObject)entity;
                    physicsObject.AttachToWorld(this.world);
                }

                if (entity.GetType() == typeof(Player))
                {
                    var player = (Player)entity;
                    player.AttachToWorld(this.world);
                }
            }
        }
Ejemplo n.º 6
0
 public PlayingGameState(Engine engine)
     : base(engine)
 {
 }
Ejemplo n.º 7
0
 public EndGameState(Engine engine)
     : base(engine)
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameState" /> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 public GameState(Engine engine)
 {
     this.engine = engine;
 }
Ejemplo n.º 9
0
 public Camera(Engine engine)
 {
     this.engine = engine;
 }