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

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

            goalCaptureModeForm.ShowDialog();
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }