Ejemplo n.º 1
0
        protected override void LoadContent()
        {
            ItemRepository.LoadRepositoryXml("Items/ItemRepository.xml", Content);

            LightShader = new LightShader(this.GraphicsDevice, CIRCLE_POINT_ACCURACY);
            LightShader.AmbientLight = new Color(30, 15, 15);
            LightShader.Enabled      = false;
            Engine.RegisterGameShader("LightShader", LightShader);

            MapEventArgs mapArgs = new MapEventArgs();

            mapArgs.SetProperty("Target", "CaveExit");
            Engine.LoadMap("Content/Maps/cave_example.tmx", mapArgs);

            CurrentSampler = SamplerStates[SamplerIndex];

            Engine.DrawingOptions.ShowEntityDebugInfo = false;
            Engine.DrawingOptions.ShowBoundingBoxes   = false;
            Engine.DrawingOptions.ShowTileGrid        = false;

            Engine.LoadContent();

            SpriteBatch = new SpriteBatch(GraphicsDevice);

            DefaultSpriteFont = Content.Load <SpriteFont>(@"Fonts\DefaultSpriteFont");
        }
Ejemplo n.º 2
0
        void MapEntrance_MapZoneHit(MapZone sender, Entity entity, TeeEngine engine, GameTime gameTime)
        {
            if (KeyboardExtensions.GetKeyDownState(Keyboard.GetState(), ACTIVATE_KEY, engine, true) &&
                entity == engine.GetEntity("Player"))
            {
                MapEventArgs mapArgs = new MapEventArgs();
                mapArgs.SetProperty("Target", Target);

                engine.ClearEntities();
                engine.LoadMap(Destination, mapArgs);
            }
        }