Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fullReset">If true, reset score and player lives as well.</param>
        public void Reset(bool fullReset)
        {
            if (fullReset) { EngineManager.Score = 0; }

            CameraManager.Reset();
            _deathTimer = new Stopwatch();
            _completedTimer = new Stopwatch();
            SceneGraphManager.Root.Nodes.Clear();
            SoundFxManager.Clear();

            LevelManager.Load(LevelManager.CurrentLevel.LevelNumber);
            LevelManager.CurrentLevel.Load();

            SkyGradient skyGradient = new SkyGradient("skygradient");
            SceneGraphManager.AddObject(skyGradient);

            player1.Reset(fullReset);
            SceneGraphManager.AddObject(player1);
        }
Пример #2
0
        public override void LoadContent()
        {
            base.LoadContent();

            LoadTextures();

            // Sounds
            SoundFxLibrary.AddToLibrary("SoundFX/bomb1", "bomb1");
            SoundFxLibrary.AddToLibrary("SoundFX/bomb2", "bomb2");
            SoundFxLibrary.AddToLibrary("SoundFX/bomb3", "bomb3");
            SoundFxLibrary.AddToLibrary("SoundFX/bomb4", "bomb4");
            SoundFxLibrary.AddToLibrary("SoundFX/huge_explosion", "huge_explosion");
            SoundFxLibrary.AddToLibrary("SoundFX/bombdrop", "bombdrop");
            SoundFxLibrary.AddToLibrary("SoundFX/bombwhistle", "bombwhistle");
            SoundFxLibrary.AddToLibrary("SoundFX/hitplane1", "hitplane1");
            SoundFxLibrary.AddToLibrary("SoundFX/hitplane2", "hitplane2");
            SoundFxLibrary.AddToLibrary("SoundFX/refill", "refill");

            player1 = new PlayerAirplane();
            // Add instruments
            throttleMeter = new Instrument("instrument", new Vector2(150, ScreenHeight), 0f, 7.5f, 0.6f, "throttle", "Throttle", player1);
            _instruments.Add("throttleMeter", throttleMeter);

            airspeedMeter = new Instrument("instrument", new Vector2(270, ScreenHeight), 0f, 13f, 0.6f, "linearvelocity", "Airspeed", player1);
            _instruments.Add("airspeedMeter", airspeedMeter);

            foreach (Instrument inst in _instruments.Values)
            {
                inst.LoadContent();
            }
            // !Add instruments

            SkyGradient skyGradient = new SkyGradient("skygradient");
            SceneGraphManager.AddObject(skyGradient);

            SceneGraphManager.AddObject(player1);
            _ammoDisplay = new AmmoDisplay((ProjectileWeapon)player1.ProjectileWeapon, (BombWeapon)player1.BombWeapon);
            _ammoDisplay.LoadContent();
            _cobraMeter = new CobraMeter(player1);

            SceneGraphManager.LoadContent();
            ParticleManager.LoadContent();
        }