예제 #1
0
        public void InitializeScene(SpriteBatch spriteBatch, World physicsWorld, Camera camera)
        {
            m_level = Level.FromFile("Content\\Levels\\level1.xml", m_game.Content);
            //m_playerStart = m_level.getItemByName("heroStart");
            InitializePhysicsScene(physicsWorld);
            InitializeLightingScene();
            CourierNew   = m_game.Content.Load <SpriteFont>("Text");
            m_shipModel  = m_game.Content.Load <Model>("Models\\ship1");
            m_floorModel = m_game.Content.Load <Model>("Models\\Ground");
            Green        = m_game.Content.Load <Texture2D>("Images/Green_Front");
            Red          = m_game.Content.Load <Texture2D>("Images/Red_Front");

            dynamicTileOne = new DynamicCollidableTile(spriteBatch, Red, new Vector2(0.0f, 0.0f), new Rectangle(0, 0, 5, 5), 0.0f, physicsWorld);
            camera.SetTrackingBody(dynamicTileOne.PhysicsBody);

            m_particleRenderer.LoadContent(m_game.Content);
            ParticleEffect pEffect = m_game.Content.Load <ParticleEffect>("ParticleEffects\\FlameThrower");

            AddParticleEffect(pEffect, dynamicTileOne);

            DirectionalLights.Add(new Lighting.DirectionalLight()
            {
                Colour         = Color.White,
                LightDirection = new Vector3(-1, -1, 0)
            });
        }
예제 #2
0
        public void InitializeScene(SpriteBatch spriteBatch, World physicsWorld, Camera camera)
        {
            m_level = Level.FromFile("Content\\Levels\\level1.xml", m_game.Content);
            //m_playerStart = m_level.getItemByName("heroStart");
            InitializePhysicsScene(physicsWorld);
            InitializeLightingScene();
            CourierNew = m_game.Content.Load<SpriteFont>("Text");
            m_shipModel = m_game.Content.Load<Model>("Models\\ship1");
            m_floorModel = m_game.Content.Load<Model>("Models\\Ground");
            Green = m_game.Content.Load<Texture2D>("Images/Green_Front");
            Red = m_game.Content.Load<Texture2D>("Images/Red_Front");

            dynamicTileOne = new DynamicCollidableTile(spriteBatch, Red, new Vector2(0.0f, 0.0f), new Rectangle(0, 0, 5, 5), 0.0f, physicsWorld);
            camera.SetTrackingBody(dynamicTileOne.PhysicsBody);

            m_particleRenderer.LoadContent(m_game.Content);
            ParticleEffect pEffect = m_game.Content.Load<ParticleEffect>("ParticleEffects\\FlameThrower");

            AddParticleEffect(pEffect, dynamicTileOne);

            DirectionalLights.Add(new Lighting.DirectionalLight()
            {
                Colour = Color.White,
                LightDirection = new Vector3(-1, -1, 0)
            });
        }