Ultimate Chess

Preview

Tech used: C++

[ GitHub ]

This was my introduction to C++. The purpose of this coursework was to practice implementation of an inheritance hierarchy and use of polymorphism in C++ and introduce ideas of 2D collision detection in computer games. I also made use of unit testing and operator overloading, things I had not done before.

Ultimate Chess in this case can be briefly summarised as:

  1. Generate a square playing field
  2. Determine how many rounds a game should play for
  3. Generate a set number of each kind of chess piece (Rook, Bishop, Queen)
  4. For each round, move every piece on the board in a random direction by a random distance, ensuring that the movement is valid for the piece. A Rook can move horizontally and vertically only, a Bishop can move diagonally only, and a Queen can move like the Rook and Bishop combined.
  5. Check for collisions, remove any pieces hit from the board, and increment the counter for the piece currently in motion
  6. The game ends when either the maximum amount of moves has been hit, or only one piece remains standing.
  7. The score for each piece is then output to the console window

A screencap of the game in play is as follows.

Gameplay in console

At the start of the screencap, there are only 12 pieces left on the board. On round 25, 3 collisions take place.