protected override void OnCancel() { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PhoneMainMenuScreen()); }
public override void BackButtonPushed() { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PhoneMainMenuScreen()); base.BackButtonPushed(); }
/// <summary> /// The "Exit" button handler uses the LoadingScreen to take the user out to the main menu. /// </summary> void exitButton_Tapped(object sender, EventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PhoneMainMenuScreen()); }
void scoreHistoryButton_Tapped(object sender, EventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new HighScoreScreen()); }
/// <summary> /// The "Resume" button handler just calls the OnCancel method so that /// pressing the "Resume" button is the same as pressing the hardware back button. /// </summary> void newGameButton_Tapped(object sender, EventArgs e) { LoadingScreen.Load(ScreenManager, true, new GameplayScreen()); }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PhoneMainMenuScreen()); } base.Update(gameTime, otherScreenHasFocus, false); SpriteBatch spriteBatch = ScreenManager.SpriteBatch; // Gradually fade in or out depending on whether we are covered by the pause screen. if (coveredByOtherScreen) { pauseAlpha = Math.Min(pauseAlpha + 1f / 32, 1); } else { pauseAlpha = Math.Max(pauseAlpha - 1f / 32, 0); } if (IsActive) { TouchCollection touches = TouchPanel.GetState(); if (touches.Count > 0) { TouchLocation touch = touches[0]; if (MenuPressed(touch, spriteBatch)) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PhoneMainMenuScreen()); } } IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); if (scores == null) { scores = new List <ScoreObject>(); if (store.FileExists(HIGHSCORE_FILE)) // Check if file exists { string scoreHistory; IsolatedStorageFileStream save = new IsolatedStorageFileStream(HIGHSCORE_FILE, FileMode.Open, store); StreamReader reader = new StreamReader(save); while ((scoreHistory = reader.ReadLine()) != null) { string[] lineParts = scoreHistory.Split(','); int lineScore = int.Parse(lineParts[0].ToString()); if (lineScore > maxScore) { maxScore = lineScore; } if (lineScore < minScore) { minScore = lineScore; } int lineAttempts = int.Parse(lineParts[1].ToString()); if (lineAttempts > maxAttempts) { maxAttempts = lineAttempts; } if (lineAttempts < minAttempts) { minAttempts = lineAttempts; } DateTime lineDate = DateTime.Parse(lineParts[2].ToString()); scores.Add(new ScoreObject(lineScore, lineAttempts, lineDate)); } reader.Close(); scores.Sort(delegate(ScoreObject s1, ScoreObject s2) { return(s1.GetRatio.CompareTo(s2.GetRatio)); }); scores.Reverse(); } } } }
void highScore_Tapped(object sender, EventArgs e) { LoadingScreen.Load(ScreenManager, true, new HighScoreScreen()); }
void aboutButton_Tapped(object sender, EventArgs e) { LoadingScreen.Load(ScreenManager, true, new AboutScreen()); }
/* * bool GetSoundOption() * { * System.IO.Stream stream = TitleContainer.OpenStream(gameOptionsFilename); * System.IO.StreamReader sreader = new System.IO.StreamReader(stream); * string line; * while ((line = sreader.ReadLine()) != null) * { * string[] options = line.Split(','); * if (options[0].ToLower() == "sounds" && options[1].ToLower() == "on") * _sounds = true; * else * _sounds = false; * } * } */ void playButton_Tapped(object sender, EventArgs e) { // When the "Play" button is tapped, we load the GameplayScreen LoadingScreen.Load(ScreenManager, true, new GameplayScreen()); }