Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            OrionEngine.Initialize(this, _graphics);
            OrionEngine.Instance.RegisterComponent(new PhysicsComponent(this, new Vector2(0.0f, 9.8f), 64f));

            LogManager.Instance.SetOutputStream(Console.Out);

            base.Initialize();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            OrionEngine.Initialize(this, _graphics);

            _camera         = new Camera2D(this);
            _camera.Enabled = true;
            Components.Add(_camera);

            base.Initialize();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            LogManager.Instance.SetOutputStream(Console.Out);
            OrionEngine.Initialize(this, _graphics);

            _camera         = new Camera2D(this);
            _camera.Enabled = true;
            Components.Add(_camera);

            base.Initialize();
        }
Ejemplo n.º 4
0
        public IScene GetScene(string objectTypeName, IFactoryManager manager, Module.Module module, XElement xmlNode)
        {
            IScene scene = null;

            if (manager is OrionEngine)
            {
                OrionEngine engine = (OrionEngine)manager;
                Camera2D    camera = engine.GetComponent <Camera2D>();

                if (camera != null)
                {
                    if (objectTypeName.Equals("Scene"))
                    {
                        scene = new Scene(engine.GraphicsDM.GraphicsDevice, camera);
                    }
                    else if (objectTypeName.Equals("ParallaxScene"))
                    {
                        scene = new ParallaxScene(engine.GraphicsDM.GraphicsDevice, camera);
                    }
                }

                if (scene != null)
                {
                    foreach (XElement sceneNode in xmlNode.Elements())
                    {
                        switch (sceneNode.Name.LocalName)
                        {
                        case "Header":
                            if (scene is Scene)
                            {
                                LoadHeader(module, sceneNode, scene as Scene);
                            }
                            else if (scene is ParallaxScene)
                            {
                                LoadHeader(module, sceneNode, scene as ParallaxScene);
                            }
                            break;

                        case "EntityList":
                            LoadEntityList(module, manager, sceneNode, scene);
                            break;
                        }
                    }
                }
            }

            return(scene);
        }