当前位置: 首页>>代码示例>>C#>>正文


C# Game.StartGame方法代码示例

本文整理汇总了C#中Game.StartGame方法的典型用法代码示例。如果您正苦于以下问题:C# Game.StartGame方法的具体用法?C# Game.StartGame怎么用?C# Game.StartGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game的用法示例。


在下文中一共展示了Game.StartGame方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MyTestInitialize

 public void MyTestInitialize()
 {
     game = new Game(120000);
     game.AddPlayer(new Player("P1"));
     game.AddPlayer(new Player("P2"));
     game.StartGame();
 }
开发者ID:ArnoldOverwater,项目名称:INFDAT01,代码行数:7,代码来源:GameTest.cs

示例2: TouchRightBorder

		public void TouchRightBorder()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			game.MoveRight();
			AdvanceTimeAndUpdateEntities(moveSpeed * gridSize / 2);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:SnakeTests.cs

示例3: TouchBottomBorder

		public void TouchBottomBorder()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			game.MoveLeft();
			AdvanceTimeAndUpdateEntities(moveSpeed);
			game.MoveDown();
			AdvanceTimeAndUpdateEntities(moveSpeed * gridSize / 2);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:SnakeTests.cs

示例4: ChangeViewPortSizeInGame

		public void ChangeViewPortSizeInGame()
		{
			var window = Resolve<Window>();
			if(window.GetType() != typeof(MockWindow))
				return; //ncrunch: no coverage
			game = new Game(window);
			game.StartGame();
			window.ViewportPixelSize = new Size(800,600);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:GameTests.cs

示例5: RespawnChunkIfCollidingWithSnake

		public void RespawnChunkIfCollidingWithSnake()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			game.Chunk.DrawArea = game.Snake.Get<Body>().BodyParts[0].DrawArea;
			Assert.IsTrue(game.Chunk.IsCollidingWithSnake(game.Snake.Get<Body>().BodyParts));
			game.RespawnChunk();
			Assert.IsFalse(game.Chunk.IsCollidingWithSnake(game.Snake.Get<Body>().BodyParts));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:SnakeGameTests.cs

示例6: GetGame

    protected Game GetGame()
    {
        Game game = new Game(new Deck());

        game.AddPlayer(new Player());
        game.AddPlayer(new Player());
        game.AddPlayer(new Player());
        game.AddPlayer(new Player());
        game.AddPlayer(new Player());
        game.StartGame();
        return game;
    }
开发者ID:Roonerelli,项目名称:Shithead,代码行数:12,代码来源:BaseGameTest.cs

示例7: RestartGameInitializesAnew

		public void RestartGameInitializesAnew()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			AdvanceTimeAndUpdateEntities();
			game.Reset();
			var keyboard = Resolve<Keyboard>();
			if (keyboard.GetType() != typeof(MockKeyboard))
				return; //ncrunch: no coverage (This is for NOT ncrunch...)
			var mockKeyboard = (MockKeyboard)keyboard;
			mockKeyboard.SetKeyboardState(Key.Y, State.Pressing);
			Assert.DoesNotThrow(() => AdvanceTimeAndUpdateEntities());
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:SnakeGameTests.cs

示例8: SnakeEatsChunk

		public void SnakeEatsChunk()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			var snakeHead = game.Snake.Get<Body>().BodyParts[0].DrawArea;
			var direction = game.Snake.Get<Body>().Direction;
			var originalLength = game.Snake.Get<Body>().BodyParts.Count;
			game.Chunk.DrawArea =
				new Rectangle(new Vector2D(snakeHead.Left + direction.X, snakeHead.Top + direction.Y),
					new Size(blockSize));
			game.MoveUp();
			AdvanceTimeAndUpdateEntities(moveSpeed);
			Assert.AreEqual(originalLength + 1, game.Snake.Get<Body>().BodyParts.Count);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:14,代码来源:SnakeGameTests.cs

示例9: DisplayGameOver

		public void DisplayGameOver()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			game.Reset();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:6,代码来源:SnakeGameTests.cs

示例10: AddToSnake

		public void AddToSnake()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			Assert.AreEqual(2, game.Snake.Get<Body>().BodyParts.Count);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:6,代码来源:SnakeTests.cs

示例11: Starting_a_game_without_at_least_two_players_throws_exception

    public void Starting_a_game_without_at_least_two_players_throws_exception()
    {
        Game game = new Game(new Deck());
        game.StartGame();

        Assert.IsTrue(game.Players.Count > 1);
    }
开发者ID:Roonerelli,项目名称:Shithead,代码行数:7,代码来源:Class1.cs

示例12: CreateAndStartGame

		private void CreateAndStartGame()
		{
			game = new Game(Resolve<Window>());
			game.StartGame();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:5,代码来源:GameTests.cs

示例13: Main

        static void Main(string[] args)
        {
            Game game = new Game();

            game.StartGame();
        }
开发者ID:entvex,项目名称:SWDcardGame,代码行数:6,代码来源:Program.cs

示例14: SetUp

		public void SetUp()
		{
			game = new Game(Resolve<Window>());
			game.StartGame();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:5,代码来源:InteractionLogicsTests.cs

示例15: MoveByTouchPositionRight

		public void MoveByTouchPositionRight()
		{
			var game = new Game(Resolve<Window>());
			game.StartGame();
			game.MoveAccordingToTouchPosition(new Vector2D(1, 0.5f));
			Assert.AreEqual(new Vector2D(1.0f / 25.0f, 0), game.Snake.Get<Body>().Direction);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:SnakeGameTests.cs


注:本文中的Game.StartGame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。