/finalproject_chessgame-chessmate

finalproject_chessgame-chessmate created by GitHub Classroom

Primary LanguageJava

Review Assignment Due Date

finalproject_chessgame-chessmate

Chess Mate

The Chess Game is a two-player strategy game where each player has a set of pieces with different movements. The objective of the game is to capture the opponent's king and avoid being captured in return. This project is a Java implementation of the Chess Game that allows users to play the game and keep track of their game history.

Rules of the Game

  • The game is played between two opponents with different colors of pieces (commonly black and white).
  • White moves first, after which the players alternate turns under fixed rules until the end of the game. A player can't make two successive moves.
  • When a player selects a piece, all possible legal moves should be highlighted in green, while moves that are not allowed should be highlighted in red. A move is not allowed if it would result in the player's own pieces being in conflict with each other, such as moving a piece to a square where another of the player's pieces is already located (this is referred to as 'blocking' and is not permitted under the rules of chess). Additionally, a move is not allowed if it would result in the player's king being in check (i.e., threatened with capture by an opponent's piece). If the king is threatened with checkmate, the move is considered an illegal move.

  • The eaten pieces of each participant should be displayed on the sidebar after they have successfully eaten a piece.
  • The win condition of chess is to force your opponent's king into checkmate (a position where it is unable to avoid capture).

Features

Piece Moves

Pawn

white pawn

Bishop

black bishop

Knight

white knight

Rook

white rook

Queen

white queen

King

white king

King under check

black king check

Timer

The game includes a timer that counts down from a set time before starting the game. Each player will have a set amount of time to complete their moves. When a player starts their turn, their timer will begin to count down. The timer will stop when the player makes their move, and then the opponent's timer will start counting down. If a player's timer reaches 0 before they make their move, they will lose the game. It's important for the player to keep track of the time remaining and make strategic moves to ensure that they don't run out of time.

User Account

The game also includes a user account system that allows users to create new account credentials (username and password). If the credentials are incorrect, an error message is displayed. When a user logs in, they can either play a new game or retrieve the scores of previous games, including the players' names and the winner, as well as the time elapsed to complete the game. Each account has its own recorded games, which are saved as files for easy retrieval. There is no need for a database to keep track of the game history.

Game Data

Game Demo

Game Demo

Conclusion

The Chess Game is a classic strategy game that requires skill and foresight to win. This Java implementation of the game includes several bonus features, such as a timer and a user account system, to enhance the gameplay experience. With this project, you can learn more about programming in Java and create a fun and engaging game that you can share with others.

Project Contributors:

1-Somaia Ahmed

2-Yasmine Mahmoud

3-Nada Khaled

4-Laila Khaled

5-Nariman Ahmed

6-Malak Emad