Moving Chessboard Pieces with Pygame

I am working in a small team of friends learning Python. To learn the basics of it we decided to build a chess game. This is the third post about it. You can see part 1 and part 2 here.

In this post, I will cover how I move the chess pieces. I do not know if this is the correct way, but for now, it works. I need to create a chessboard class and also move some of the properties of the board to there such as the squares, but for now, the chessboard is just a method in main.py. The code below shows part of the main loop that deals with mouse clicks.

… 
 

Creating a Chessboard with Pygame Part 2

Recently I wrote about learning Python by creating a chess game. I am new to Python, although not new to programming. Python has intrigued me for the last few months, especially how popular it seems to be (second place on GitHub fourth quarter 2020). When an opportunity came up to work with some friends and learn it I jumped at it.

Chess Game

In the last post about the chess game I wrote about getting familiar with Pygame and was able to programmatically draw a chessboard on the screen. I didn’t make much of an attempt at classes and structuring the program in any good way. In this post, I want to show what I have managed to accomplish as part of my teamwork. The image above shows how it looks now when I run the program.

…