Reader small image

You're reading from  Tkinter GUI Application Development Blueprints

Product typeBook
Published inNov 2015
Reading LevelExpert
PublisherPackt
ISBN-139781785889738
Edition1st Edition
Languages
Right arrow
Author (1)
Bhaskar Chaudhary
Bhaskar Chaudhary
author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary

Right arrow

Making the game functional


Now that we have all the chess pieces and chessboard-related validation rules in place, let's now add life to our chess program. In this iteration, we will make our chess game fully functional.

The objective of this iteration is to move the chess pieces with a click of the left mouse button. When a player clicks on a chess piece, the code should first check whether it is a legitimate turn for that chess piece.

On the first click, the chess piece that needs to be moved is selected, and all the allowed moves for that chess piece are highlighted on the chessboard. The second click should be performed on the destination square. If the second click is done on a valid destination square, the chess piece should move from the source square to the destination square.

We also need to code the events of capturing chess pieces and the King being in check. The other attributes that need to be tracked include a list of the captured chess pieces, the half-move clock count, the full...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Tkinter GUI Application Development Blueprints
Published in: Nov 2015Publisher: PacktISBN-13: 9781785889738

Author (1)

author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary