public void PlaySound(StageScript.StageScriptRunner caller, int which) { try { this.Level.CurrentStage.Sounds[which].Play(); } catch (IndexOutOfRangeException) { caller.ThrowException("Sound effect " + which.ToString() + " out of range"); } }
public void SetBackground(StageScript.StageScriptRunner caller, int which) { if (which < 0) { this.BackgroundPatternManager.Pattern = null; return; } try { this.BackgroundPatternManager.Pattern = this.Level.CurrentStage.BackgroundTexture[which]; } catch (IndexOutOfRangeException) { caller.ThrowException("Background pattern " + which.ToString() + " out of range"); } }