Mankala Boardgame in Java
Description
Mancala is a generic name that encompasses a family of two-player board games. Mancala plays a similar role in African and Asian countries as chess does in Europe. I am implementing a specific rule-based implementation of this family. The game board can be taken as a 2x8 matrix, in which the first and last columns can be understood as a hole, and each row of every other column can also be considered as a hole, so the board consists of a total of 12 single-cell and 2 2-cell holes.
Implementation
I implemented the game in Java and used Java Swing for the graphical display.
Class Diagram
User manual
When you start the game, the menu appears, where you can set the names of the two players. You can start a new game with New Game, while you can continue the last saved game state with Load Game. At the bottom of the menu, you can set whether you want to play against the machine or alone. When the game starts, the menu closes and the game board opens. The player whose name is in the bottom row starts. According to the rules, he can select the hole from which he wants to throw the stones by clicking on the specified button. After that, the move takes place, which can be seen on the game board, and the other player's turn follows, which can also be seen at the bottom of the screen. If you are playing against the machine, the machine's move happens directly after your own move, so you don't have to wait for it to think. By clicking on the surrender button, the game ends and the opposing player wins. If the game ends with someone's victory, the program will display the winner, then after confirming this, you will return to the main menu, from where you can start a new game.
Screenshots
Menu screen
You can play it with your friend or against the computer.
Game
The board is made up of buttons, by clicking on the appropriate one, we can choose from which the stones will be taken out.
Projects Content
Folder(s)/File(s) | about |
---|---|
mankala | The source of the projekt |
Dokumentáció.pdf | Hungarian documentation |