コード例 #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
ファイル: Session.cs プロジェクト: jasongdove/BreakoutClone
        // 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
ファイル: BallInLevel.cs プロジェクト: whztt07/DeltaEngine
		public BallInLevel(Paddle paddle, Level level)
			: base(paddle)
		{
			Level = level;
		}
コード例 #4
0
ファイル: BallInLevel.cs プロジェクト: hillwhite/DeltaEngine
 public BallInLevel(Paddle paddle, Content content, InputCommands inputCommands, Level level)
     : base(paddle, content, inputCommands)
 {
     Level = level;
 }