Exemple #1
0
 public StartMenuScreen(GameManager gameManager)
     : base(gameManager)
 {
     var menuItems = new List<MenuItem>
     {
         new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")),
         new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen")),
         new MenuItem(Strings.HIGH_SCORES, LinkType.Transition, () => gameManager.ChangeScreen("HighScoresScreen")),
     };
     _menu = new Menu(gameManager, menuItems);
 }
 public HighScoresScreen(GameManager gameManager)
     : base(gameManager)
 {
     _highScores = new ImageFile { Text = Strings.HIGH_SCORES, Scale = new Vector2(2f, 2f) };
     _menu = new Menu(gameManager, new[]
     {                
         new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")), 
         new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen"))
     });
    
     _scoresImageFiles = new List<ImageFile>();
 }
Exemple #3
0
 public GameOverScreen(GameManager gameManager)
     : base(gameManager)
 {
     _menu = new Menu(gameManager, new[]
     {
         new MenuItem(Strings.UPLOAD_SCORE, LinkType.Switch, UploadGameScore), 
         new MenuItem(Strings.HIGH_SCORES, LinkType.Transition, () => gameManager.ChangeScreen("HighScoresScreen")), 
         new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")), 
         new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen")),
     });
     _gameOver = new ImageFile { Text = Strings.GAME_OVER, Scale = new Vector2(2f, 2f) };
     _score = new ImageFile { Text = String.Format("{0}: {1}", Strings.YOUR_SCORE, gameManager.PlayerStats.CurrentScore) };
     _highScore = new ImageFile { Text = String.Format("{0}: {1}", Strings.YOUR_HIGH_SCORE, gameManager.PlayerStats.HighScore) };
 }
 public OptionsMenuScreen(GameManager gameManager)
     : base(gameManager)
 {
     _gameManager = gameManager;
     var sound = gameManager.SoundManager.EffectsOn ? Strings.ON : Strings.OFF;
     var music = gameManager.SoundManager.MusicOn ? Strings.ON : Strings.OFF;
     _soundMenuItem = new MenuItem(String.Format("{0}: {1}", Strings.SOUND, sound), LinkType.Switch, SwitchSoundEffects);
     _musicMenuItem = new MenuItem(String.Format("{0}: {1}", Strings.MUSIC, music), LinkType.Switch, SwitchMusic);
     var menuItems = new List<MenuItem>
     {
         _soundMenuItem,
         _musicMenuItem,
         new MenuItem(Strings.BACK, LinkType.Transition, () => gameManager.ChangeScreen("StartMenuScreen")),
     };
     _menu = new Menu(gameManager, menuItems);
 }