private void MovePlayerToHomeZone(Player player, GameModel game, Form form) { for (int i = 0; i < 50; i++) { player.MoveUp(form); player.MoveLeft(form); game.CheckFlagCapture(); game.CheckIfFlagIsAtHomeZone(); } }
public void Should_ChangePlayerSizeIfFlagIsCaptured() { var testGame = new GameModel(300, 300, 0, 2); var testForm = new CaptureTheFlagMode(testGame); var player = testGame.Players.First(); player.SetPosition(testGame.Flag.X, testGame.Flag.Y); testGame.CheckFlagCapture(); Assert.AreNotEqual(player.Width, player.OriginalWidth); Assert.AreNotEqual(player.Height, player.OriginalHeight); }
public void Should_ChangePlayerSpeedIfFlagIsCaptured() { var testGame = new GameModel(300, 300, 0, 2); var testForm = new CaptureTheFlagMode(testGame); var player = testGame.Players.First(); var startSpeed = player.Speed; player.SetPosition(testGame.Flag.X, testGame.Flag.Y); testGame.CheckFlagCapture(); Assert.AreNotEqual(startSpeed, player.Speed); }
public void Should_CaptureTheFlag() { var testGame = new GameModel(300, 300, 0, 2); var testForm = new CaptureTheFlagMode(testGame); var player = testGame.Players.First(); player.SetPosition(testGame.Flag.X, testGame.Flag.Y); testGame.CheckFlagCapture(); Assert.AreEqual(true, player.HasFlag); Assert.AreEqual(testGame.Flag.Owner, player); }
public void Should_SetPlayerSpeedToNormalIfFlagIsAtHomeZone() { var testGame = new GameModel(100, 100, 0, 2); var testForm = new CaptureTheFlagMode(testGame); var player = testGame.Players.First(); player.SetPosition(testGame.FieldWidth / 2, testGame.FieldHeight / 2); testGame.CheckFlagCapture(); var playerChangedSpeed = player.Speed; MovePlayerToHomeZone(player, testGame, testForm); Assert.AreNotEqual(player.Speed, playerChangedSpeed); }