예제 #1
0
파일: Game.cs 프로젝트: whztt07/DeltaEngine
		//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
		public BallInLevel(Paddle paddle, Level level)
			: base(paddle)
		{
			Level = level;
		}
예제 #3
0
 public BallInLevel(Paddle paddle, Content content, InputCommands inputCommands, Level level)
     : base(paddle, content, inputCommands)
 {
     this.level = level;
 }