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)

Comments

  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.
    Thanks!!!

    ReplyDelete
    Replies
    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 :-)

      Delete
  2. You possess lifted an essential offspring..Blesss for using..I would want to study better latest transactions from this blog..preserve posting.. best hospital for lasik eye surgery in delhi

    ReplyDelete
  3. Our the purpose is to share the reviews about the latest Jackets,Coats and Vests also share the related Movies,Gaming, Casual,Faux Leather and Leather materials available Sabrina Coat

    ReplyDelete
  4. Thanks for this. This is the simplest explanation I can understand given the tons of Explanation here. teen misty blazer

    ReplyDelete
  5. I am glad to be here and read your very interesting article, it was very informative and helpful information for me. keep it up. ronda rousey jacket

    ReplyDelete
  6. The Most Iconic Video Slots On The Planet - Jancasino
    The most https://septcasino.com/review/merit-casino/ iconic video slot is the 7,800-calibre slot gri-go.com machine called Sweet 출장샵 Bonanza. This slot machine was gri-go.com developed in 2011, developed in the same jancasino.com studio by

    ReplyDelete
  7. Fantastic blog i have never ever read this type of amazing information. BTS Jimin Teddy Jacket

    ReplyDelete

Post a Comment

Popular posts from this blog

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

Developing Minesweeper using Java