public virtual void Play() { while (gameStatus == GameStatus.PLAY) { int temp_x = player.X, temp_y = player.Y; Thread.Sleep(speedGame); player.Run(); RunEnemies(); FireAndViewProjectiles(); RunProjectiles(); Interaction_ProjectilesWithObjects(); Interaction_EnemiesWithEnemies(); Interaction_PlayerWithWalls(temp_x, temp_y); Interaction_PlayerWithEnemies(); checkSimpleTanksInteractWalls(); checkHunterTanksInteractWalls(); checkWinGame(); } if (gameStatus == GameStatus.LOSE) { MessageBoxManager.OK = okMessage; MessageBoxManager.Register(); MessageBox.Show(loseMessage); MessageBoxManager.Unregister(); srf = new SaveResultForm(score.CurrentScore, true); srf.ShowDialog(); } if (gameStatus == GameStatus.WIN) { if (Properties.Settings.Default.mode == 0) { MessageBoxManager.OK = okMessage; MessageBoxManager.Register(); MessageBox.Show(winMessage); MessageBoxManager.Unregister(); } srf = new SaveResultForm(score.CurrentScore, true); srf.ShowDialog(); } }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (modelPlay != null) { model.GameStatus = GameStatus.STOP; modelPlay.Abort(); SetLanguageButtonsToPlay(); } srf = new SaveResultForm(model.Score.CurrentScore, false); srf.ShowDialog(); }