Пример #1
0
		//ncrunch: no coverage end

		private void InitGame()
		{
			Show();
			if (menu != null)
				menu.Hide();
			if (restartCommand != null && restartCommand.IsActive)
				restartCommand.Dispose(); //ncrunch: no coverage
			if (backToMenuCommand != null && backToMenuCommand.IsActive)
				backToMenuCommand.Dispose(); //ncrunch: no coverage
			if (gameOverMessage != null)
				gameOverMessage.Dispose(); //ncrunch: no coverage
			score = new Score();
			currentLevel = new Level(score);
			ball = new BallInLevel(new Paddle(), currentLevel);
			new UI(window, this);
			//ncrunch: no coverage start
			score.GameOver += () =>
			{
				RemoveOldObjects();
				gameOverMessage = new FontText(Font.Default, "That's it.\nGame Over!\n\nPress \"Q\" to " +
					"go back to the Main Menu.", Rectangle.One);
				restartCommand = new Command(InitGame).Add(new KeyTrigger(Key.Space)).
					Add(new MouseButtonTrigger()).Add(new TouchTapTrigger());
				backToMenuCommand = new Command(BackToMainMenu).Add(new KeyTrigger(Key.Q));
			};
			//ncrunch: no coverage end
			Score = score;
		}
Пример #2
0
        // TODO: Get level id
        public Session(Rectangle screenBounds)
        {
            _screenBounds = screenBounds;
            _world = new World(new Vector2(0, 10));

            _player = new Player();
            _player.Lives = 3;

            _level = new Level(_world, screenBounds, _player);
        }
Пример #3
0
		public BallInLevel(Paddle paddle, Level level)
			: base(paddle)
		{
			Level = level;
		}
Пример #4
0
 public BallInLevel(Paddle paddle, Content content, InputCommands inputCommands, Level level)
     : base(paddle, content, inputCommands)
 {
     Level = level;
 }