private void Ih_SpacePressed(object sender, EventArgs e) { MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); mp.ShuffledNextSong(); //MediaPlayer.IsShuffled = true; //MediaPlayer.MoveNext(); }
private void Ps_ParticleHitPlayer(object sender, EventArgs e) { if (sender != null && sender is Player) { Player player = (Player)sender; MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); player.Shield--; this._particlesPerGame++; this._shieldHit++; if (player.Shield <= 0) { mp.ShuffledNextSong(); //MediaPlayer.IsShuffled = true; //MediaPlayer.MoveNext(); } } }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public void Update(GameTime gameTime) { MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); DynamicWorldCounter dwc = this._mainGame.GameManager.GetComponent <DynamicWorldCounter>(); InputHandler ih = this._mainGame.GameManager.GetComponent <InputHandler>(); if (!this._mainGame.IsActive) { this._mainGame.ResetElapsedTime(); if (!this._mainGame.IsPaused) { this.PauseGame(); } } if (!this._mainGame.IsPaused) { if (gameTime.TotalGameTime - this._previouslyGameTime > this._mainGame.OneSecond) { this._previouslyGameTime = gameTime.TotalGameTime; } if (gameTime.TotalGameTime - this._prevMusicTime > mp.MusicTick) { ParticleSystems ps = this._mainGame.GameManager.GetComponent <ParticleSystems>(); if (this._timeToBonus > 0) { this._timeToBonus--; } if (this._timeToBonus == 0) { ps.BonusFieldPrepar = true; } if (ps.BonusFieldActive) { this._bonusTime--; } if (this._bonusTime == 0) { ps.BonusFieldPrepar = false; ps.BonusFieldActive = false; this._timeToBonus = 35; this._bonusTime = 5; } //when music time is over and song didnt changed if (this._musicMinutes == 0 && this._musicSeconds == 0) { mp.ShuffledNextSong(); } this.CalculateTimeToEnd(); this._prevMusicTime = gameTime.TotalGameTime; } } }