Esempio n. 1
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            base.LoadContent();

            _Player = new Player(this, _PlayerInitialPosition);
            _Camera = new Camera(this, ResolutionManager.VirtualWidth, ResolutionManager.VIRTUAL_HEIGHT, _CameraInitialPositionCenter);

            _Player.PlayerMoved += _Camera.UpdateCameraPosition;

            ObjectManager.AddObjects(_Scenery.ToArray());
            ObjectManager.AddObjects(_Player, _Camera);

            // A real game would probably have more content than this sample, so
            // it would take longer to load. We simulate that by delaying for a
            // while, giving you a chance to admire the beautiful loading screen.
            Thread.Sleep(1000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            CutlassEngine.Game.ResetElapsedTime();

            SoundId backgroundMusic = SoundManager.AddSound(new CutlassSong("Content/Sounds/Music/Constance"));

            SoundManager.GetSound(backgroundMusic).Play();
        }