Example #1
0
        protected override void LoadContent()
        {
            FontManager.LoadFonts(this);
            TextureManager.LoadTextures(this);

            spriteBatch = new SpriteBatch(GraphicsDevice);

            mapCreator = new MapCreator(this, "Scenario000.xml", 60, 80,
                new Vector2(36.0f, 36.0f));

            gameCamera = mapCreator.Camera;
        }
Example #2
0
        private void loadScenario(string scenarioName)
        {
            try
            {
                //currentScenario = Content.Load<Scenario>(GlobalGameSettings.Game.Scenario);
                currentScenario = Content.Load<Scenario>(scenarioName);

                WorldDimensions = new Rectangle(0, 0,
                    currentScenario.MapDescription.TilesAcross * (int)currentScenario.MapDescription.TileSize.X,
                    currentScenario.MapDescription.TilesDown * (int)currentScenario.MapDescription.TileSize.Y);
                WorldCenter = new Vector2(WorldDimensions.Width, WorldDimensions.Height) / 2;

                GameMap = new Map(currentScenario.MapDescription);
                playerManager = new PlayerManager(currentScenario.PlayerDescription);
                enemyManager = new EnemyManager(currentScenario.EnemiesDescription);

                gameCamera = new Camera(graphics.GraphicsDevice, playerManager.Player.Position);
                gameCamera.Magnification = 1.5f;
            }
            // Super hack for when scenarioNumber becomes larger than the number of scenarios.
            catch (ContentLoadException)
            {
                gameState = GameState.WonGame;
            }
        }