예제 #1
0
        private void ButtonCreate_OnClick(object sender, RoutedEventArgs e)
        {
            if (ComboBoxIP.SelectedItem == null || TextBoxGameName.Text == "" || TextBoxPort.Text == "" ||
                TextBoxPseudo.Text == "")
            {
                _mainWindow.ShowMessageAsync("Paramètres incorrects", "Veuillez remplir tout les champs.");
                return;
            }
            Uri uri =
                new Uri("net.tcp://" + ComboBoxIP.SelectedItem + ":" + TextBoxPort.Text + "/" + TextBoxGameName.Text +
                        TextBoxPseudo.Text);
            WaitJoinWindow waitJoinWindow = new WaitJoinWindow(uri, GetComboBoxColor());

            if (waitJoinWindow.ShowDialog() == true)
            {
                GameFactory gameFactory = new GameFactory();
                BoardView   boardView   = new BoardView(_container);
                Core.Game   game        = gameFactory.CreateGame(Mode.Network, _container, boardView, GetComboBoxColor(), null);
                _mainWindow.MainControl.Content = new GameView(_mainWindow, game, boardView);
            }
            else
            {
                // Attention : pratique choquante
                try
                {
                    NetworkServiceHost.Close();
                }
                catch (Exception)
                {
                    ; //Rien à faire (technique de pro)
                }
                _mainWindow.ShowMessageAsync("Erreur réseau", "Il y a eu un problème lors de la connexion avec l'autre joueur... Vueillez réessayer.");
            }
        }
예제 #2
0
        public HistoryView(GameView gameView)
        {
            InitializeComponent();
            _game = gameView.Game;

            _gameView      = gameView;
            _realBoardView = gameView.UcBoardView.Content as BoardView;
            _conversation  = new HistoryViewConversation();

            foreach (ICompensableCommand command in _game.Container.Moves)
            {
                ICompensableCommand momand = command.Copy(_board);
                _conversation.Execute(momand);
                _moves.Add(momand);
            }

            _game.Container.Moves.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Add)
                {
                    ICompensableCommand command = args.NewItems[args.NewItems.Count - 1] as ICompensableCommand;
                    command = command.Copy(_board);
                    _conversation.Execute(command);
                    _moves.Add(command);
                }
                if (args.Action == NotifyCollectionChangedAction.Remove)
                {
                    _moves.RemoveAt(_moves.Count - 1);
                    _conversation.Undo();
                }
            };

            _boardView = new BoardView(new Container(_board, _moves));
            ListViewHistory.ItemsSource = _moves;
        }
예제 #3
0
        private void GamePropertyChanged(Core.Game oldValue, Core.Game newValue)
        {
            if (oldValue != null)
            {
                oldValue.Team1.Agent1.PropertyChanged -= Cell_PropertyChanged;
                oldValue.Team1.Agent2.PropertyChanged -= Cell_PropertyChanged;
                oldValue.Team2.Agent1.PropertyChanged -= Cell_PropertyChanged;
                oldValue.Team2.Agent2.PropertyChanged -= Cell_PropertyChanged;
            }

            Field = null;

            if (newValue != null)
            {
                Field = newValue.Field;

                newValue.Team1.SynchronizationContext = System.Threading.SynchronizationContext.Current;
                newValue.Team2.SynchronizationContext = System.Threading.SynchronizationContext.Current;

                newValue.Team1.Agent1.PropertyChanged += Cell_PropertyChanged;
                newValue.Team1.Agent2.PropertyChanged += Cell_PropertyChanged;
                newValue.Team2.Agent1.PropertyChanged += Cell_PropertyChanged;
                newValue.Team2.Agent2.PropertyChanged += Cell_PropertyChanged;

                UpdateCellAgents();
            }
        }
예제 #4
0
        public GameViewModel(Core.Game game, IDialogService dialogService, bool isPlayingAutomatically)
        {
            _game                      = game;
            _dialogService             = dialogService;
            UndoCommand                = new ActionCommand(DoUndo, CanUndo);
            RedoCommand                = new ActionCommand(DoRedo, CanRedo);
            CurrentHistoryPosition     = 0;
            RobotThinkingTime          = 5;
            _isPlayingAutomatically    = isPlayingAutomatically;
            _emptyCellsPlayerViewModel = new EmptyCellsPlayerViewModel(_game.EmptyCellsAsPlayer);
            _playerOne                 = new HumanPlayerViewModel(_game.MainPlayer, _emptyCellsPlayerViewModel.PlayerPositions.ToList());
            _playerTwo                 = new RobotPlayerViewModel(_game.RobotPlayer, _emptyCellsPlayerViewModel.PlayerPositions.ToList());

            var playerOneCollectionContainer = new CollectionContainer {
                Collection = _playerOne.PlayerPositions
            };
            var playerTwoCollectionContainer = new CollectionContainer {
                Collection = _playerTwo.PlayerPositions
            };
            var emptyCollectionContainer = new CollectionContainer {
                Collection = _emptyCellsPlayerViewModel.PlayerPositions
            };

            _positions.Add(playerOneCollectionContainer);
            _positions.Add(playerTwoCollectionContainer);
            _positions.Add(emptyCollectionContainer);

            WaitMove();
        }
예제 #5
0
        protected override void OnCreate( Bundle savedInstanceState )
        {
            base.OnCreate(savedInstanceState);

            if(String.IsNullOrWhiteSpace(Intent.GetStringExtra("Playname")))
            {
                Toast.MakeText(this, "Sorry playname not valid!", ToastLength.Long).Show();
                Finish();
                return;
            }

            game = new Core.Game(Intent.GetStringExtra("Playname"));

            SetContentView(Resource.Layout.Game);

            question = FindViewById<TextView>(Resource.Id.GameQuestion);
            btnAnswer1 = FindViewById<Button>(Resource.Id.GameBtnAnswer1);
            btnAnswer2 = FindViewById<Button>(Resource.Id.GameBtnAnswer2);
            btnAnswer3 = FindViewById<Button>(Resource.Id.GameBtnAnswer3);
            btnAnswer4 = FindViewById<Button>(Resource.Id.GameBtnAnswer4);

            btnAnswer1.Click += (sender, args) => CheckAnswer(0);
            btnAnswer2.Click += (sender, args) => CheckAnswer(1);
            btnAnswer3.Click += (sender, args) => CheckAnswer(2);
            btnAnswer4.Click += (sender, args) => CheckAnswer(3);

            SetQuestionViews(game.GetCurrentQuestion());
        }
예제 #6
0
 [STAThread] //Такой типа (?) потока нужен для работы Input.Keyboard как минимум
 static void Main(string[] args)
 {
     //if (System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LeftShift) == true)
     //    MessageBox.Show("Got it!");
     Console.ForegroundColor = ConsoleColor.Green;
     Console.WriteLine("Processing...");
     Core.Game game = new Core.Game();
     //Console.ReadLine();
 }
예제 #7
0
        private void LocalGameButton_OnClick(object sender, RoutedEventArgs e)
        {
            GameFactory gameFactory = new GameFactory();
            BoardView   boardView   = new BoardView(_container);

            Core.Game game = gameFactory.CreateGame(Mode.Local, _container, boardView, Color.White, null);

            _mainWindow.MainControl.Content = new GameView(_mainWindow, game, boardView);
        }
예제 #8
0
 static void Main(string[] args)
 {
     //if (System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LeftShift) == true)
     //    MessageBox.Show("Got it!");
     Console.ForegroundColor = ConsoleColor.Green;
     Console.WriteLine("Processing...");
     Core.Game game = new Core.Game();
     //Console.ReadLine();
 }
예제 #9
0
        public ContentResult Put([FromBody] dynamic json)
        {
            try
            {
                var param1 = json.Game.ToString().Trim();
                var param2 = json.Player.ToString().Trim();
                int param3 = (int)json.X;
                int param4 = (int)json.Y;

                Core.Game game = Core.Server.Game(param1);
                if (game == null)
                {
                    return new ContentResult()
                           {
                               StatusCode = (int)HttpStatusCode.NotFound, Content = "Game not found"
                           }
                }
                ;
                else if (!game.HasPlayer(param2))
                {
                    return new ContentResult()
                           {
                               StatusCode = (int)HttpStatusCode.NotFound, Content = "Player not found"
                           }
                }
                ;
                else if (game.State != GameState.Playing)
                {
                    return new ContentResult()
                           {
                               StatusCode = (int)HttpStatusCode.Forbidden, Content = "Game over"
                           }
                }
                ;
                else
                {
                    Command cmd = new Command();

                    cmd.Action = Model.Action.Attack;
                    cmd.Sender = param2;
                    cmd.Target = new Position(param3, param4);
                    game.Enqueue(cmd);
                    return(new ContentResult()
                    {
                        StatusCode = (int)HttpStatusCode.OK
                    });
                }
            }
            catch
            {
                return(new ContentResult()
                {
                    StatusCode = (int)HttpStatusCode.BadRequest
                });
            }
        }
예제 #10
0
        public GameView(MainWindow mainWindow, Core.Game game, BoardView boardView)
        {
            InitializeComponent();
            _mainWindow = mainWindow;
            _boardView  = boardView;
            Game        = game;

            game.PlayerDisconnectedEvent += GameOnPlayerDisconnectedEvent;

            game.StateChanged += _boardView.GameStateChanged;

            game.StateChanged += state =>
            {
                switch (state)
                {
                case BoardState.BlackCheckMate:
                    _mainWindow.ShowMessageAsync("Fin de la partie", "Le joueur noir est echec et mat.",
                                                 MessageDialogStyle.AffirmativeAndNegative);
                    break;

                case BoardState.WhiteCheckMate:
                    _mainWindow.ShowMessageAsync("Fin de la partie", "Le joueur blanc est echec et mat.",
                                                 MessageDialogStyle.AffirmativeAndNegative);
                    break;

                case BoardState.BlackPat:
                    _mainWindow.ShowMessageAsync("Match nul", "Le joueur noir est pat.",
                                                 MessageDialogStyle.AffirmativeAndNegative);
                    break;

                case BoardState.WhitePat:
                    _mainWindow.ShowMessageAsync("Match nul", "Le joueur blanc est pat.",
                                                 MessageDialogStyle.AffirmativeAndNegative);
                    break;
                }
            };

            //Création et ajout du contenu du PLS pour cette vue
            GameViewFlyout gameViewFlyout = new GameViewFlyout(this);

            _mainWindow.Flyout.Content = gameViewFlyout.Content;
            UcBoardView.Content        = boardView;

            game.Container.MoveDone += move =>
            {
                LabelPlayerTurn.Content = move.PieceColor == Color.Black ? "Blanc" : "Noir";
            };

            game.Container.MoveUndone += move =>
            {
                LabelPlayerTurn.Content = move.PieceColor == Color.Black ? "Blanc" : "Noir";
            };

            HistoryView.Content = new HistoryView(this);
        }
예제 #11
0
        private void ButtonJoin_OnClick(object sender, RoutedEventArgs e)
        {
            if (ComboBoxIP.SelectedItem == null ||
                TextBoxGameName.Text == "" ||
                TextBoxPort.Text == "" ||
                TextBoxPseudo.Text == "" ||
                TextBoxHostIP.Text == "" ||
                TextBoxHostPort.Text == "" ||
                TextBoxHostPseudo.Text == "")
            {
                _mainWindow.ShowMessageAsync("Paramètres incorrects", "Veuillez remplir tout les champs");
                return;
            }


            //Création du service
            Uri uri =
                new Uri("net.tcp://" + ComboBoxIP.SelectedItem + ":" + TextBoxPort.Text + "/" + TextBoxGameName.Text +
                        TextBoxPseudo.Text);

            NetworkServiceHost.Create(uri);
            NetworkServiceHost.Open();

            //On créer le client et on informe l'autre service de l'adresse de notre service
            Uri hostUri =
                new Uri("net.tcp://" + TextBoxHostIP.Text + ":" + TextBoxHostPort.Text + "/" + TextBoxGameName.Text +
                        TextBoxHostPseudo.Text);
            EndpointAddress endpointAddress = new EndpointAddress(hostUri);

            NetworkServiceClient.Create(endpointAddress);
            try
            {
                NetworkServiceClient.Channel().SendClientAdress(uri.ToString());
            }
            catch (Exception)
            {
                _mainWindow.ShowMessageAsync("Erreur réseau",
                                             "Il y a eu un problème lors de la connexion avec l\'autre joueur, cela peut provenir des paramètres que vous avez saisis.");
                return;
            }

            Color distantPlayerColor = NetworkServiceClient.Channel().GetColor() == "White" ? Color.White : Color.Black;
            Color color = distantPlayerColor == Color.White ? Color.Black : Color.White;

            NetworkServiceHost.GetService().PlayerColor = color;

            GameFactory gameFactory = new GameFactory();
            BoardView   boardView   = new BoardView(_container);

            Core.Game game = gameFactory.CreateGame(Mode.Network, _container, boardView, color, null);
            _mainWindow.MainControl.Content = new GameView(_mainWindow, game, boardView);
        }
예제 #12
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            //TODO le controle pour l'antoine
            GameFactory gameFactory = new GameFactory();
            BoardView   boardView   = new BoardView(_container);
            int         skillLevel  = ComboBoxLevel.SelectedValue as int? ?? 0;
            int         searchValue = ComboBoxValue.SelectedValue as int? ?? 0;

            Core.Game game = gameFactory.CreateGame(Mode.AI, _container, boardView, Color.White, new GameCreatorParameters()
            {
                AiSearchType  = ComboBoxSearchMode.SelectedIndex == 0 ? "depth" : "movetime",
                AiSearchValue = searchValue,
                AiSkillLevel  = skillLevel
            });
            _mainWindow.MainControl.Content = new GameView(_mainWindow, game, boardView);
        }
예제 #13
0
        public override Core.Game CreateGame(Container container, BoardView boardView, Color color, GameCreatorParameters parameters)
        {
            IEngine engine = new RealEngine(container);

            Core.Game game;
            // Si le joueur local est blanc
            if (color == Color.White)
            {
                PlayerControler whitePlayerControler = new BoardViewPlayerController(boardView);
                PlayerControler blackPlayerControler = new NetworkPlayerController(NetworkServiceHost.GetNetworkServiceHost());

                Player whitePlayer = new Player(Color.White, whitePlayerControler);
                Player blackPlayer = new Player(Color.Black, blackPlayerControler);

                game = new Core.Game(engine, whitePlayer, blackPlayer, container, false);

                whitePlayer.Game = game;
                blackPlayer.Game = game;

                whitePlayerControler.Player = whitePlayer;
                blackPlayerControler.Player = blackPlayer;

                boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)whitePlayerControler);
            }
            else
            {
                PlayerControler whitePlayerControler = new NetworkPlayerController(NetworkServiceHost.GetNetworkServiceHost());
                PlayerControler blackPlayerControler = new BoardViewPlayerController(boardView);

                Player whitePlayer = new Player(Color.White, whitePlayerControler);
                Player blackPlayer = new Player(Color.Black, blackPlayerControler);

                game = new Core.Game(engine, whitePlayer, blackPlayer, container, false);

                whitePlayer.Game = game;
                blackPlayer.Game = game;

                whitePlayerControler.Player = whitePlayer;
                blackPlayerControler.Player = blackPlayer;

                boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)blackPlayerControler);
            }

            //SMTPLogger smtpLogger = new SMTPLogger(game);
            return(game);
        }
예제 #14
0
        static void Main()
        {
            var appSettings = new AppSettings();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (appSettings.ShowSplashScreen)
            {
                Application.Run(new WelcomeScreenForm());
            }
            var game = new Core.Game();

            if (appSettings.ShowChoosePlayersScreen)
            {
                Application.Run(new ChoosePlayersForm(game));
            }
            Application.Run(new MainForm(game));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            game = new SpartaQuiz.Core.Game(playername);

            question = new UILabel(new RectangleF(10, 80, View.Frame.Width - 20, 20));
            View.AddSubview(question);

            btnAnswer1 = new UIButton(new RectangleF(10, 80, View.Frame.Width - 20, 20));
            View.AddSubview(btnAnswer1);

            btnAnswer2 = new UIButton(new RectangleF(10, 110, View.Frame.Width - 20, 20));
            View.AddSubview(btnAnswer2);

            btnAnswer3 = new UIButton(new RectangleF(10, 140, View.Frame.Width - 20, 20));
            View.AddSubview(btnAnswer3);

            btnAnswer4 = new UIButton(new RectangleF(10, 170, View.Frame.Width - 20, 20));
            View.AddSubview(btnAnswer4);
        }
예제 #16
0
파일: PlayScreen.cs 프로젝트: sunny-lan/Uso
        public PlayScreen(MainGame.Globals globals, SongLoader previous, Song s, SongSettings songSettings)
        {
            this.globals  = globals;
            this.previous = previous;


            ts = new SimpleTimeSource(s.PPQ, s.InitialTempo);
            //var stf = new StaffRenderer(theme, , s);
            sR = new StaffRenderer(globals.Theme, new MV
            {
                ts       = ts,
                interval = s.PPQ * 4,
            }, s);


            g   = new Core.Game(s, songSettings.MidiOut, ts, this);
            inp = new Mono.KeyboardMIDIInput(g);

            ctr = new ComboCounter(globals.Theme.TestFont, ts);

            g.Play();
        }
예제 #17
0
        public override Core.Game CreateGame(Container container, BoardView boardView, Color color, GameCreatorParameters parameters)
        {
            IEngine         engine = new RealEngine(container);
            PlayerControler whitePlayerControler = new BoardViewPlayerController(boardView);
            PlayerControler blackPlayerControler = new UciProcessController(container, parameters.AiSearchType, parameters.AiSkillLevel, parameters.AiSearchValue);
            Player          whitePlayer          = new Player(Color.White, whitePlayerControler);
            Player          blackPlayer          = new Player(Color.Black, blackPlayerControler);

            Core.Game game = new Core.Game(engine, whitePlayer, blackPlayer, container, true);

            whitePlayer.Game = game;
            blackPlayer.Game = game;

            whitePlayerControler.Player = whitePlayer;
            blackPlayerControler.Player = blackPlayer;

            boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)whitePlayerControler);

            //TODO Remvoe the logger
            //SMTPLogger smtpLogger = new SMTPLogger(game);
            return(game);
        }
예제 #18
0
        private async void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            Input = new DefaultInput(TextBox);
            HistoryListBox.ItemsSource = Input.LastCommands;
            Output = new DefaultOutput(RichTextBlock);
            SoundManager = new SoundManager();

            var filesFolder = await Package.Current.InstalledLocation.GetFolderAsync("Files");
            var commandsStream = await filesFolder.OpenStreamForReadAsync("Commands.xml");
            var storyStepsStream = await filesFolder.OpenStreamForReadAsync("StorySteps.xml");
            var audioFilesStream = await filesFolder.OpenStreamForReadAsync("Sounds.xml");

            Game = new Core.Game(
                Input,
                Output,
                SoundManager,
                audioFilesStream,
                commandsStream,
                storyStepsStream);
            Game.Start();

            TextBox.IsEnabled = true;
        }
예제 #19
0
        protected override void LoadContent()
        {
            sb    = new SpriteBatch(GraphicsDevice);
            theme = new Theme();
            theme.LoadBasic(Content);

            var loadMidi  = Task.Run(() => new MidiFile("Assets/desire_drive.mid"));
            var loadTheme = Task.Run(() => theme.LoadFromContent(Content));
            var output    = midiManager.CreateOutput();

            Task.Run(async() =>
            {
                // TODO: use this.Content to load your game content here
                var s = MidiToSong.FromMidi(await loadMidi);


                ts = new SimpleTimeSource(s.PPQ, s.InitialTempo);
                //var stf = new StaffRenderer(theme, , s);
                await loadTheme;
                sR = new StaffRenderer(theme, new MV
                {
                    ts       = ts,
                    interval = s.PPQ * 4,
                }, s);

                var mout = await output;

                g   = new Core.Game(s, mout, ts, this);
                inp = new Mono.KeyboardMIDIInput(g);

                ctr = new ComboCounter(theme.TestFont, ts);

                loading = false;
                g.Play();
            });
        }
예제 #20
0
파일: Program.cs 프로젝트: CupWorks/GGJ2016
        private static void Main(string[] args)
        {
            CheckWindowSize();
            var defaultsFileStream = new FileStream("Files/Defaults.xml", FileMode.Open);
            var commandsFileStream = new FileStream("Files/Commands.xml", FileMode.Open);
            var storyStepsFileStream = new FileStream("Files/StorySteps.xml", FileMode.Open);
            var soundsFileStream = new FileStream("Files/Sounds.xml", FileMode.Open);

            var input = new ConsoleInput();
            var game = new Core.Game(
                input,
                new ConsoleOutput(),
                new SoundManager(),
                defaultsFileStream,
                soundsFileStream,
                commandsFileStream,
                storyStepsFileStream);
            game.Start();

            do
            {
				CheckWindowSize();
            } while (game.IsRunning);
        }
예제 #21
0
 internal Camera(Core.Game game, Vector2 position, float startZoom)
     : this(game.GraphicsDevice, game.SCALED_ZOOM, startZoom)
 {
     _position        = position;
     _transformMatrix = setTransform();
 }
예제 #22
0
        public GameScreen(int size, int playersCount, int realPlayersCount, List <string> playersNames)
        {
            this.Size = (int)Math.Sqrt(Math.Pow((double)(playersCount + 1), (double)playersCount));
            this.game = new Core.Game(playersNames, playersCount, realPlayersCount);
            this.game.StartLevel(this.Size, this.Size, playersCount + 1);
            SoundPlayer gameMedia   = new SoundPlayer(Properties.Resources.bensound_punky);
            SoundPlayer buttonClick = new SoundPlayer(Properties.Resources.button_click);

            gameMedia.PlayLooping();
            var exitButton = new Button();

            table           = new TableLayoutPanel();
            table.BackColor = Color.FromArgb(173, 216, 230);
            table.Location  = new Point(2, 2);
            table.Size      = new Size(76 * this.Size, 76 * this.Size);
            for (int i = 0; i < this.Size; i++)
            {
                table.RowStyles.Add(new RowStyle(SizeType.Percent, 100f / this.Size));
                table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f / this.Size));
            }
            for (int column = 0; column < this.Size; column++)
            {
                for (int row = 0; row < this.Size; row++)
                {
                    var button = new Button();
                    button.BackColor = Color.FromArgb(255, 255, 255);
                    button.Size      = new Size(66, 66);
                    button.FlatStyle = FlatStyle.Standard;
                    button.Click    += (senders, args) =>
                    {
                        var position = table.GetCellPosition((Control)senders);
                        this.game.CurrentLevel.MakeMove(position.Column, position.Row);
                        this.Map = this.game.CurrentLevel.Map;
                        ChangeMap();
                        if (!(this.game.CurrentLevel.Winner == null) || this.game.CurrentLevel.IsDraw == true)
                        {
                            string winnerName = "";
                            var    draw       = this.game.CurrentLevel.IsDraw;
                            if (!(this.game.CurrentLevel.Winner == null))
                            {
                                winnerName = game.CurrentLevel.Winner.Name;
                            }
                            this.Hide();
                            gameMedia.Stop();
                            GameOverScreen gameOver = new GameOverScreen(size, playersCount, realPlayersCount, playersNames, winnerName, draw);
                            gameOver.Show();
                        }
                    };
                    table.Controls.Add(button, column, row);
                }
            }


            // Game Screen Settins
            this.AutoScaleMode   = AutoScaleMode.None;
            this.BackColor       = Color.FromArgb(173, 216, 230);
            this.ClientSize      = new Size(76 * this.Size, 76 * this.Size + 60);
            this.MinimumSize     = new Size(76 * this.Size, 76 * this.Size + 60);
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.None;

            exitButton.Anchor       = AnchorStyles.Left;
            exitButton.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            exitButton.Cursor       = Cursors.Hand;
            exitButton.FlatStyle    = FlatStyle.Popup;
            exitButton.Font         = new Font("MV Boli", 20.25F);
            exitButton.BackColor    = Color.FromArgb(74, 118, 168);
            exitButton.ForeColor    = Color.FromArgb(0, 0, 0);
            exitButton.ImageAlign   = ContentAlignment.BottomCenter;
            exitButton.Location     = new Point(ClientSize.Width / 2 - 90, ClientSize.Height - 50);
            exitButton.Text         = "Main Menu";
            exitButton.Size         = new Size(180, 40);
            exitButton.Click       += (sender, args) =>
            {
                buttonClick.Play();
                Thread.Sleep(150);
                gameMedia.Stop();
                this.Hide();
                var mainScreen = new MainScreen(this.Size, playersCount, realPlayersCount);
                mainScreen.Show();
            };

            Controls.Add(table);
            Controls.Add(exitButton);
        }