PvP Chain reaction game using Python

At last, I've taken time and ventured a little deeper into the Python language! I used the Tkinter package to develop a rip-off of an android game called chain-reaction. It's a simple multiplayer board game in which the first person to occupy all the blocks on the board or of the opponent(s) wins. Try downloading and playing the game with your friends, it's FUN!

Here's a video of the game I've developed(I've set the number of players to 4 and board dimensions are 6*8):

Coming to the coding, I actually enjoyed the process of writing code much more in Python compared to any other previous languages that I've used. Maybe it is due to the fact that it's the first high-level language that I got my hands on. I'd never worked with Tkinter package before. It was quite easy to understand and I was able to build the game in roughly in four hours. I think that just a little effort is enough for anyone to understand how to use the tkinter package.

Talking about the game it's quite simple to understand it if you play it. Simply speaking, if a block reaches its maximum capacity then it diffuses the contents to its neighbors(North, East, West, and South). A little bit knowledge about recursion can help you code the game with ease.

Here's the code for the game:

I could have used the random package to implement a bot(an opponent) that randomly selects tiles and make the game a little more interesting. But my aim was to just fiddle with the tkinter and I'm happy with the end result.

If you have a Python IDE go ahead and try to run the code and have fun :) (You can modify the code to adjust number of players and the dimensions of the board)


  1. What is the name of the package you imported? "tkinter" has like 8 different packages and I don't know which package to install in my repositories.

    1. I don't remember installing anything extra. The tkinter library was there downloaded by default. I'm afraid I can't help you with your question. Just do trial and error :-)

  2. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    Data Science Course in Pune
    Python Classes in Pune


Post a Comment

Popular posts from this blog

Beginner's guide to Solving the N-Queens problem using backtracking method

Developing Minesweeper using Java