Prog 4: Color Match

Create the interface to allow playing the Color Match game. (This is based on the excellent Android game Coloroid written by Ben Lewis.) 

Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move the user chooses a color, and all squares with that color join the captured area. The program keeps track of how many moves are made, comparing it to "par" for that level. If the user matches or beats par, play continues to the next level up. Screenshots of playing the game will look like what is shown below, where the render window with the colored blocks is shown on the left, and the color of the user input mouse clicked square is shown on the right.  Note that in our version it doesn't matter which square is clicked.

Note that the Codio starter code project for Program 4 includes a version of the program that can be launched from the command line.

RenderWindow

User clicks on:

 1. Red square 

 2. Cyan square 

 3. Blue square 

 4. Black square 

 5. Green square 

 6. Cyan square 

 7. Blue square 

 8. Yellow square 

 9. Red square 

At the bottom of the screen you would now get a message, indicating you had made 9 moves on a par 8 board.  Since the number of moves was greater than par, the game would not continue.  If the user had finished the board within par number of moves, then the board would reset with n + 1 number of squares on each side, where n is the number of squares on each side in the previous level.

(Par 8) Move 1

(Par 8) Move 2

(Par 8) Move 3

(Par 8) Move 4

(Par 8) Move 5

(Par 8) Move 6

(Par 8) Move 7

(Par 8) Move 8

(Par 8) Move 9

(Par 8) You had 9 moves.

When a user succeeds in converting the board to the same color within par number of moves, then play continues at the next level, which in this case would be level 5, which might look like:

Similarly if the user succeeds at level 5, then a level 6 board would be given:

and so on. Play continues until the user succeeds at a 24 x 24 board (shown below).

 

You need to know the following concepts in order to write this program:

        Everything from the first three programs; Using arrays; Use of random number generator; Using classes and objects; Sample SFML graphics code

Notes and Points:

To earn points, the following steps must be completed in order.  For example, you only get the points for step 3 (message at bottom of the screen) if your program has completed steps 1 and 2.

I suggest you follow the outlined sections shown in the starter code that comes with the project in Codio.