//----------------------//------------------------//

        public override void LoadContent()
        {
            base.LoadContent();

            var viewportSize = SceneManager.Instance.VirtualSize;
            _camera = new Camera2D(SceneManager.Instance.ViewportAdapter);

            // Player init
            _player = new Player(ImageManager.loadCharacter("Player"));

            // Enemies init
            _enemies = new List<Enemy>();

            // Projectiles init
            _projectilesTextures = new Dictionary<string, Texture2D>()
            {
                {"common", ImageManager.loadProjectile("Common")},
                {"cannonball", ImageManager.loadProjectile("Cannonball")}
            };
            _projectiles = new List<GameProjectile>();
            _shotSe = SoundManager.LoadSe("Shot");
            _projectilesColliderTexture = new Texture2D(SceneManager.Instance.GraphicsDevice, 1, 1);
            _projectilesColliderTexture.SetData<Color>(new Color[]{ Color.Orange });

            // Shops init
            _shops = new List<GameShop>();

            // Checkpoints init
            _checkpoints = new List<GameCheckpoint>();

            // Coins init
            _coins = new List<GameCoin>();
            _coinsSe = SoundManager.LoadSe("Coins");

            // Random init
            _rand = new Random();

            // Stage Complete Helper init
            _stageCompletedHelper = new SceneMapSCHelper();

            // Pause helper init
            _pauseHelper = new SceneMapPauseHelper();

            // Ambience SE init
            var ambienceSe = SoundManager.LoadSe("Ambience");
            if (ambienceSe == null)
            {
                _ambienceSe = null;
            }
            else
            {
                _ambienceSe = ambienceSe.CreateInstance();
                _ambienceSe.IsLooped = true;
            }

            // Load the map
            LoadMap(SceneManager.Instance.MapToLoad);

            // Create the HUD
            CreateHud();

            // Background init
            _backgroundHelper = new SceneMapBackgroundHelper();

            // Start BGM and Ambience SE
            SoundManager.StartBgm(SoundManager.BGMType.Map);
            _ambienceSe.PlaySafe();
        }
示例#2
0
        //----------------------//------------------------//

        public override void LoadContent()
        {
            base.LoadContent();

            var viewportSize = SceneManager.Instance.VirtualSize;

            _camera = new Camera2D(SceneManager.Instance.ViewportAdapter);

            // Player init
            _player = new Player(ImageManager.loadCharacter("Player"));

            // Enemies init
            _enemies         = new List <Enemy>();
            _enemiesToRemove = new List <Enemy>();

            // Projectiles init
            _projectilesTextures = new Dictionary <string, Texture2D>()
            {
                { "common", ImageManager.loadProjectile("Common") },
                { "cannonball", ImageManager.loadProjectile("Cannonball") }
            };
            _projectilesToRemove = new List <GameProjectile>();
            _projectiles         = new List <GameProjectile>();
            _shotSe = SoundManager.LoadSe("Shot");
            _projectilesColliderTexture = new Texture2D(SceneManager.Instance.GraphicsDevice, 1, 1);
            _projectilesColliderTexture.SetData(new Color[] { Color.Orange });

            // Shops init
            _shops = new List <GameShop>();

            // Checkpoints init
            _checkpoints = new List <GameCheckpoint>();

            // Coins init
            _coinsToRemove = new List <GameCoin>();
            _coins         = new List <GameCoin>();
            _coinsSe       = SoundManager.LoadSe("Coins");

            // Random init
            _rand = new Random();

            // Stage Complete Helper init
            _stageCompletedHelper = new SceneMapSCHelper();

            // Pause helper init
            _pauseHelper = new SceneMapPauseHelper();

            // Ambience SE init
            var ambienceSe = SoundManager.LoadSe("Ambience");

            if (_ambienceSe != null)
            {
                _ambienceSe          = ambienceSe.CreateInstance();
                _ambienceSe.IsLooped = true;
            }

            // SEs init
            _deflectSe = SoundManager.LoadSe("Deflect");

            // Load the map
            LoadMap(SceneManager.Instance.MapToLoad);

            // Create the HUD
            CreateHud();

            // Background init
            _backgroundHelper = new SceneMapBackgroundHelper();

            // Ambience SE
            _ambienceSe.PlaySafe();

            // Save the initial data
            PlayerManager.Instance.StoreData();
        }