Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            PathGameType pgt = new PathGameType();

            pgt.Show();
            Application.Current.MainWindow = null;
            this.Close();
        }
Ejemplo n.º 2
0
        public PathGameType()
        {
            //Initialize the components
            InitializeComponent();
            main = this;
            CenterWindowOnScreen();
            col = 10; row = 10;
            PathGenerator pg = new PathGenerator(25, col, row);

            coordonatesPoints = pg.GeneratePath();
            MakeTheGrid(col, row);

            //Create the players based on the user choise
            InitializeThePlayers();

            //Intialize the game and put it on a new thread so the UI doesn't freez
            Game   = new PathGame(new PathBoard(25), new Random(), 6, players, new DiceManager(1));
            thread = new Thread(() =>
            {
                Game.Start();
            });
            thread.Start();
        }