top of page

Clock game

Updated: Oct 18, 2022

This project was made for an assignment using C++ and SFML. The game displays one digital clock and 3 analogue ones and the user is tasked with selecting which one displays the time on the digital one. All clocks update real-time.

ree

After selection the game lets the player know whether the choice was correct or not.

ree
ree

The clocks are initialised with random time values, then one analogue clock is picked to initialise the digital clock.

ree

While this could have been achieved with an overloaded assignment operator, since the initialisation function was already available to achieve the same result, that would have been unnecessary extra work.

ree

On the other hand, I wanted to show my tutor my ability to use operator overloading, so I did implement it when comparing time values.

ree

This is inherited from the Clock parent class, so can be used for both anaglogClock, and digitalClock.


 
 
 

Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page