예제 #1
0
        /// <summary>
        /// Spawns the player.
        /// </summary>
        /// <param name="player">The player.</param>
        public virtual void SpawnPlayer(Player player)
        {
            this._player = player;

            // Make sure the sound manager knows about this player
            SoundEffectManager manager = this.ScreenManager.GetService <SoundEffectManager>();

            manager.SetPlayer(player);
        }
예제 #2
0
        /// <summary>
        /// Called when a collision happens.
        /// </summary>
        /// <param name="info">The collision information.</param>
        public override void HandleCollisions(CollisionInfo info)
        {
            var player = info.Obstacle as Player;

            if ((player != null) && this._isActive)
            {
                SoundEffectManager manager = this.GetService <SoundEffectManager>();
                manager.PlayDollarSound();
                this._isActive = false;
                CollisionManager.Collection.QueuePendingRemoval(this);
            }
        }
예제 #3
0
        /// <summary>
        /// Constructs a new screen manager component.
        /// </summary>
        public ScreenManager(SoftProGame game)
            : base(game)
        {
            this._pointManager          = new ObjectValueManager();
            this._settingsManager       = new SettingsManager();
            this._site                  = game.Services;
            this._content               = new ContentManager(this._site, "Content");
            this._graphicsDeviceService = this._site.GetService <IGraphicsDeviceService>();
            this._input                 = new InputState(game);
            this._soundManager          = new SoundEffectManager();
            this._graphicsManager       = game.Graphics;

            if (this._graphicsDeviceService == null)
            {
                throw new InvalidOperationException("No graphics device service.");
            }

            this.KeyboardDispatcher = new KeyboardDispatcher(game.Window);
        }
예제 #4
0
 /// <summary>
 /// Called when a random sound should be played
 /// </summary>
 /// <param name="manager"></param>
 protected override void OnPlayRandomSound(SoundEffectManager manager)
 {
     manager.PlayQuiz();
 }
예제 #5
0
 /// <summary>
 /// Called when a random sound should be played
 /// </summary>
 protected abstract void OnPlayRandomSound(SoundEffectManager manager);