Example #1
0
 public ChessBoard()
 {
     InitializeComponent();
     board = Board.GetStartingBoard();
     board.PropertyChanged += (sender, args) => UpdateCells();
     UpdateCells();
 }
Example #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            texSprites = Content.Load<Texture2D>(@"SpriteS");

            b = new Board(texSprites);

            // TODO: use this.Content to load your game content here
        }
Example #3
0
        public GamePlay()
        {
            Player p1 = new Player(p1Settings, 0);
            Player p2 = new Player(p2Settings, 1);
            p1.next = p2;
            p2.next = p1;
            currPl = p1;

            board = new Board();

            cam = p1.cam.clone();
        }
Example #4
0
        public void Start()
        {
            Player1 = new HumanPlayer(true);
            Player2 = new HumanPlayer(false);
            CurrentPlayer = Player1;

            CreateCheckers(false);
            CreateCheckers(true);

            // TEST SITUATION #1
            //CheckersSet.Add(new Checker(true, true, 2, 3)); // CHECKER WE TEST
            //CheckersSet.Add(new Checker(false, true, 0, 1));
            //CheckersSet.Add(new Checker(false, true, 1, 2));
            //CheckersSet.Add(new Checker(false, true, 1, 4));
            //CheckersSet.Add(new Checker(false, true, 0, 5));
            //CheckersSet.Add(new Checker(true, true, 7, 0));

            // TEST SITUATION #2
            //CheckersSet.Add(new Checker(true, false, 2, 3)); // CHECKER WE TEST
            //CheckersSet.Add(new Checker(true, false, 7, 0));
            //CheckersSet.Add(new Checker(false, false, new Coordinate(4, 3)));
            //CheckersSet.Add(new Checker(true, false,new Coordinate(5, 2)));

            // TEST SITUATION #3 - white cheker is surrounded with reds
            //CheckersSet.Add(new Checker(true, false, 3, 4)); // CHECKER WE TEST
            //CheckersSet.Add(new Checker(false, false, 2, 3));
            //CheckersSet.Add(new Checker(false, false, 2, 5));
            //CheckersSet.Add(new Checker(false, false, 4, 3));
            //CheckersSet.Add(new Checker(false, false, 4, 5));

            // TEST SITUATION #4 - compound move
            //CheckersSet.Add(new Checker(true, false, 4, 3)); // CHECKER WE TEST
            //CheckersSet.Add(new Checker(false, false, 3, 4));
            //CheckersSet.Add(new Checker(false, false, 1, 4));
            //CheckersSet.Add(new Checker(false, false, 1, 2));
            //CheckersSet.Add(new Checker(false, false, 3, 2));


            // TEST SITUATION #5 - the only white checker is blocked
            //CheckersSet.Add(new Checker(true, false, 4, 3)); // CHECKER WE TEST
            //CheckersSet.Add(new Checker(false, false, 3, 4));
            //CheckersSet.Add(new Checker(false, false, 2, 5));
            //CheckersSet.Add(new Checker(false, false, 3, 2));
            //CheckersSet.Add(new Checker(false, false, 2, 1));

            Board = new Board();
            Board.Draw(CheckersSet);
        }
Example #5
0
        public void Start()
        {
            player1 = new HumanPlayer(true);
            player2 = new HumanPlayer(false);
            CurrentPlayer = player1;

            checkers.Create(false);
            checkers.Create(true);

            // TEST SITUATION #1
            //checkers.Set.Add(new Checker(true,  true, new Coordinate(2, 3))); // CHECKER WE TEST
            //checkers.Set.Add(new Checker(true,  true, new Coordinate(7, 0)));
            //checkers.Set.Add(new Checker(false, true, new Coordinate(0, 1)));
            //checkers.Set.Add(new Checker(false, true, new Coordinate(1, 2)));
            //checkers.Set.Add(new Checker(false, true, new Coordinate(1, 4)));
            //checkers.Set.Add(new Checker(false, true, new Coordinate(0, 5)));

            // TEST SITUATION #2
            //checkers.Set.Add(new Checker(true,  false, new Coordinate(2, 3))); // CHECKER WE TEST
            //checkers.Set.Add(new Checker(true,  false, new Coordinate(7, 0)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(6, 1)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(5, 2)));

            // TEST SITUATION #3 - white cheker is surrounded with reds
            //checkers.Set.Add(new Checker(true, false,  new Coordinate(3, 4))); // CHECKER WE TEST
            //checkers.Set.Add(new Checker(false, false, new Coordinate(2, 3)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(2, 5)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(4, 3)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(4, 5)));

            // TEST SITUATION #4 - compound move
            //checkers.Set.Add(new Checker(true,  false, new Coordinate(4, 3))); // CHECKER WE TEST
            //checkers.Set.Add(new Checker(false, false, new Coordinate(3, 4)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(1, 4)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(1, 2)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(3, 2)));

            // TEST SITUATION #5 - the only white checker is blocked
            //checkers.Set.Add(new Checker(true,  false, new Coordinate(4, 3))); // CHECKER WE TEST
            //checkers.Set.Add(new Checker(false, false, new Coordinate(3, 4)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(2, 5)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(3, 2)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(2, 1)));

            // TEST SITUATION #6 - for Take tests
            //checkers.Set.Add(new Checker(true,  false, new Coordinate(2, 1)));
            //checkers.Set.Add(new Checker(false, false, new Coordinate(1, 2)));

            Board = new Board();

            Screen.SetGraphicParameters();

            Board.Draw(checkers);

            while (!IsGameOver())
            {
                FindCheckersWithTakes();
                SetMove();
                SwitchPlayer();
            }
            Screen.GameOverMessage();
        }