private void StartNewGameModeGame()
        {
            var goalCaptureModeGame = new GameModel(selectedFormWidth, selectedFormHeight, ballsCount, playersCountSelection);

            goalCaptureModeGame.SetGameTime(selectedGametime);
            var goalCaptureModeForm = new GoalCaptureModeForm(goalCaptureModeGame);

            goalCaptureModeForm.ShowDialog();
        }
Ejemplo n.º 2
0
        public void Should_AddPointIfGoalCaptured()
        {
            var testGame = new GameModel(100, 100, 0, 1);
            var testForm = new GoalCaptureModeForm(testGame);
            var player   = testGame.Players.First();

            CreateNewZoneInGoalCaptureMode(testGame, player);

            Assert.AreEqual(1, player.Score);
        }
Ejemplo n.º 3
0
        public void Should_SlowDownPlayerInSlowDownZone()
        {
            var testGame = new GameModel(100, 100, 0, 1);
            var testForm = new GoalCaptureModeForm(testGame);
            var player   = testGame.Players.First();

            while (testGame.SlowDownZones.Count < 1)
            {
                CreateNewZoneInGoalCaptureMode(testGame, player);
            }
            testGame.CheckSlowDownZones();

            Assert.AreEqual(testGame.SlowDownZones.First().PlayerSpeedInsideZone, player.Speed);
        }
Ejemplo n.º 4
0
        public void Should_IncreasePlayerSizeInSizeIncreaseZone()
        {
            var testGame = new GameModel(100, 100, 0, 1);
            var testForm = new GoalCaptureModeForm(testGame);
            var player   = testGame.Players.First();

            while (testGame.SizeIncreaseZones.Count < 1)
            {
                CreateNewZoneInGoalCaptureMode(testGame, player);
            }
            testGame.CheckSizeIncreaseZones();

            Assert.AreEqual(testGame.SizeIncreaseZones.First().PlayerWidthIncreaseValue, player.Width);
            Assert.AreEqual(testGame.SizeIncreaseZones.First().PlayerHeightIncreaseValue, player.Height);
        }
Ejemplo n.º 5
0
        public void Should_ChangeToOriginalPlayerSpeedAfterEscapingSlowDownZone()
        {
            var testGame = new GameModel(100, 100, 0, 1);
            var testForm = new GoalCaptureModeForm(testGame);
            var player   = testGame.Players.First();

            while (testGame.SlowDownZones.Count < 1)
            {
                CreateNewZoneInGoalCaptureMode(testGame, player);
            }
            testGame.CheckSlowDownZones();
            player.SetPosition(player.OriginalPosition);
            testGame.CheckSlowDownZones();

            Assert.AreEqual(player.OriginalSpeed, player.Speed);
        }
Ejemplo n.º 6
0
        public void Should_ChangeToOrginalPlayerSizeAfterEscapingSizeIncreaseZone()
        {
            var testGame = new GameModel(100, 100, 0, 1);
            var testForm = new GoalCaptureModeForm(testGame);
            var player   = testGame.Players.First();

            while (testGame.SizeIncreaseZones.Count < 1)
            {
                CreateNewZoneInGoalCaptureMode(testGame, player);
            }
            testGame.CheckSizeIncreaseZones();
            player.SetPosition(player.OriginalPosition);
            testGame.CheckSizeIncreaseZones();

            Assert.AreEqual(player.OriginalWidth, player.Width);
            Assert.AreEqual(player.OriginalHeight, player.Height);
        }