public override void OnPress(int key) { SoundFactory.PlaySoundEffect(SoundFactory.Pause()); if (MediaPlayer.State == MediaState.Playing) { MediaPlayer.Pause(); } else { MediaPlayer.Resume(); } foreach (SpriteLayer layer in this.game.Layers) { layer.Paused = !layer.Paused; } foreach (InputController ic in this.toPause) { ic.Paused = !ic.Paused; } }