本文整理汇总了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();
}
示例2: TouchRightBorder
public void TouchRightBorder()
{
var game = new Game(Resolve<Window>());
game.StartGame();
game.MoveRight();
AdvanceTimeAndUpdateEntities(moveSpeed * gridSize / 2);
}
示例3: TouchBottomBorder
public void TouchBottomBorder()
{
var game = new Game(Resolve<Window>());
game.StartGame();
game.MoveLeft();
AdvanceTimeAndUpdateEntities(moveSpeed);
game.MoveDown();
AdvanceTimeAndUpdateEntities(moveSpeed * gridSize / 2);
}
示例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);
}
示例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));
}
示例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;
}
示例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());
}
示例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);
}
示例9: DisplayGameOver
public void DisplayGameOver()
{
var game = new Game(Resolve<Window>());
game.StartGame();
game.Reset();
}
示例10: AddToSnake
public void AddToSnake()
{
var game = new Game(Resolve<Window>());
game.StartGame();
Assert.AreEqual(2, game.Snake.Get<Body>().BodyParts.Count);
}
示例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);
}
示例12: CreateAndStartGame
private void CreateAndStartGame()
{
game = new Game(Resolve<Window>());
game.StartGame();
}
示例13: Main
static void Main(string[] args)
{
Game game = new Game();
game.StartGame();
}
示例14: SetUp
public void SetUp()
{
game = new Game(Resolve<Window>());
game.StartGame();
}
示例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);
}