Beispiel #1
0
 /// <summary>
 /// £aduje grê z zapisanego pliku o podanej nazwie
 /// </summary>
 /// <param name="saveName">Nazwa pliku z zapisem</param>
 public void LoadGame(string saveName)
 {
     var saveData = SavedGamesManager.LoadGame(saveName);
     CurrentLevel = new Level(this,saveData);
 }
Beispiel #2
0
 /// <summary>
 /// Wykonuje akcje po ukoñczeniu gry - zapisuje wynik, pokazuje informacjê o ukoñczeniu gry i wraca do menu g³ównego.
 /// </summary>
 private void OnLastLevelComplete()
 {
     HighScoresManager.AddHighScore(SettingsManager.Instance.PlayerName,CurrentLevel.Player.Points,SettingsManager.Instance.Difficulty);
     CurrentLevel = null;
     var gameplayScreen = ScreenManager.GameStateKeeper.GetActiveGameplayScreen();
     ScreenManager.RemoveScreen(gameplayScreen);
     var gameEndedMessageBox = new MessageBoxScreen("All levels complete!", true, MessageBoxType.Info);
     gameEndedMessageBox.Accepted += gameEndedMessageBox_Accepted;
     gameEndedMessageBox.Cancelled += gameEndedMessageBox_Accepted;
     ScreenManager.AddScreen(gameEndedMessageBox);
 }
Beispiel #3
0
 /// <summary>
 /// Tworzy now¹ grê
 /// </summary>
 public void NewGame()
 {
     _currentLevelNumber = 0;
     CurrentLevel = new Level(this, _levelList[0]);
 }
Beispiel #4
0
 /// <summary>
 /// £aduje kolejny poziom
 /// </summary>
 public void LoadNextLevel()
 {
     if (_currentLevelNumber < _levelList.Count - 1)
     {
         CurrentLevel = new Level(this, _levelList[++_currentLevelNumber], CurrentLevel.Player);
         CurrentLevel.Initialize();
     }
     else
     {
         OnLastLevelComplete();
     }
 }
Beispiel #5
0
 /// <summary>
 /// £aduje poziom o podanej nazwie
 /// </summary>
 /// <param name="name">Nazwa poziomu</param>
 public void LoadLevel(string name)
 {
     CurrentLevel = new Level(this, name);
     CurrentLevel.Initialize();
 }
Beispiel #6
0
 public Camera(Viewport viewport, Level level, Player playerToFollow)
 {
     _viewport = viewport;
     _level = level;
     _playerToFollow = playerToFollow;
 }