project-ee10cffd

byДанилко Курілкін

> Create a fully standalone HTML game "Tower Checkers (Bashni, Column Checkers)" for two players. Everything should work in one HTML file (HTML + CSS + JavaScript), without third-party libraries and the Internet. Basic requirements 8×8 field. 12 white and 12 black checkers. Play only on dark squares. White moves first. Highlight possible moves. Highlight all possible captures. Forbid any illegal moves. Fully support multiple captures in one move. Show the winner after the game is over. "New game" button. Undo last move button. Rules Use Russian checkers rules, but with the mechanics of column checkers (Bashni): 1. A regular checker moves forward diagonally one square. 2. The queen moves any distance diagonally. 3. Capture is mandatory. 4. If there are several capture options, the player can choose any. 5. The checker captures forward and backward. 6. The queen captures at any distance. 7. After capturing, if the next capture is possible with the same rook, the move continues. 8. If during the capture series a checker reaches the last row, it immediately becomes a queen and continues to capture as a queen. Rules of towers This is the most important part. The captured checker is NOT removed from the board. It is placed UNDER the checker that captured it. Thus, a tower (column) is formed. The tower moves as one piece. The type of tower is determined by the TOP checker. If there is a simple checker on top, the rook moves as a simple checker. If there is a queen on top, the rook moves as a queen. If the rook is captured, ONLY the top checker is removed. The rest of the rook remains in place. If after removing the top checker, a checker of a different color appears on top, the rook passes under the control of another player. If there was a queen inside the rook, after opening it has the status of a queen again. Internal structure Each cell should store an array: [ {color:"white", king:false}, {color:"black", king:true}, ... ] The top element of the array is the top of the rook. All algorithms should work with this structure. Interface A beautiful chessboard. Rooks are displayed as stacks of checkers. Show its height next to the rook. The queen should have a crown. Select the selected tower. Animation of movement. Animation of capture. Display of the turn order. Algorithms Implement: search for all possible moves; search for all possible series of captures; check for legality of the move; automatic completion of the series of captures; determination of the end of the game; check for blocking of the opponent. The code should be well structured: Board class; Game class; Renderer class; separate functions: getLegalMoves() getCaptures() makeMove() undoMove() promoteIfNeeded() checkGameOver() It is forbidden to duplicate the code. Finally, before generation, check the logic of the Bashni rules yourself again, especially: transfer of towers; capture of only the top checker; transformation into a queen during a series of captures; multiple captures; proper tower control switching. Undo function. The result should be a ready-to-run HTML file without errors. @Consider

GameTower Checkers Game
Game

Comments (0)

No comments yet. Be the first!

Game design preview
Game: View Board
Game: Start New Game
Game: Select Checker
Game: View Highlighted Moves
Game: Move Checker
Game: View Highlighted Captures
Game: Capture Checker
Game: Continue Capture Sequence
Game: Form Tower
Game: Promote to Queen
Game: Undo Last Move
Game: Check Game Over
Game: View Winner
Game design preview
Game: View Board
Game: Start New Game
Game: Select Checker
Game: View Highlighted Moves
Game: Move Checker
Game: View Highlighted Captures
Game: Capture Checker
Game: Continue Capture Sequence
Game: Form Tower
Game: Promote to Queen
Game: Undo Last Move
Game: Check Game Over
Game: View Winner