Beispiel #1
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            gameFont = content.Load<SpriteFont>("gamefont");

            if (loadingGame)
            {
                enemyManager = new EnemyManager();
                enemyManager.LoadContent(content);

                gameMap = Map.Load("map.txt", content);

                LoadSaveManager.LoadGame(ref gameHero);

                gameHero.LoadContent(content);
            }
            else
            {
                enemyManager = new EnemyManager();
                enemyManager.LoadContent(content);

                gameMap = Map.Load("map.txt", content);

                gameHero = new Hero(gameMap.PlayerSpawn);
                gameHero.LoadContent(content);
            }

            /// CAMERA STUFF: instantiate the camera, passing in the game's viewport (our visible draw surface)
            gameCamera = new Camera(ScreenManager.Game.GraphicsDevice.Viewport);

            ScreenManager.Game.ResetElapsedTime();
        }
Beispiel #2
0
 public EnemyManager()
 {
     // Set the singleton reference to this new instance
     Instance = this;
 }