April 2018
Beginner
714 pages
18h 21m
English
By adding a few lines of code, we managed to make the board clickable. We connected a custom slot that reads which field was clicked on and can highlight it with a semitransparent red color. Clicking on another field will move the highlighted piece there. The highlighting system we developed is very generic. We use it to highlight a single field with a solid color, but you can mark as many fields as you want with a number of different colors, for example, to show valid moves after selecting a piece. The system can easily be extended with new types of highlights; for example, you can draw arrows on the board using QPainterPath to have a complex hinting system (say, showing the player the suggested move).
Read now
Unlock full access