MASTER MINDS Game Development

It took around a week for me to develop the game, I am so elated to share how I made my first game with python with an interactive GUI. The below two pics depicts how the game’s home page and game main page look like.

Home page
Game main page

By merely looking at the game, You get to know that it’s a mind game. Here you are given 10 chances and 8 balls to guess a correct quad (4) of balls, you can expect repetitions as well. Every time you made a guess, you receive a hint about the guess made, an orange eye indicate that one of your quad balls is in the sequence and is in exact position and a blue eye indicate that one of your balls is in the sequence but not in exact position. Game terminates whether in success which can happen either in 1st guess if you are so lucky or within 10 guesses if you have used your brain very well or in failure. The figures below depicts the game loose and game won pages.

Game loose page
Game won page

I have developed GUI in such a way that the game is more interactive and challenging and is also enthusiastic with a pleasant background music. Every image except those settings, info, control logos in first page are made by me, windows 3D paint app helped me for this, I have drawn all those 3D spheres and rounded rectangles with it, I have added additional stickers so that balls look nice and funny.I have made an additional confirmation page which is displayed when you try to close any of the game pages.

Exit confirmation page

Game highlights:

I have handled undo and redo operations to handle quad corrections made during game play. The DELETE key does UNDO operation and the INSERT key does REDO operation all these changes are limited to a single quad guess.

The user can enter the game page through the ENTER key as well.

The text part that is to be of high priority is animated with different colors.

I have added two different background musics one is for the home page and the other is for the Game main page.

How I made this game:

This game is already an existing one, The thing here is that you can’t find python code for it, I did all by my own. I first saw this game in the Ubuntu store, I played it for around 30 times, not on the same day, I then thought of developing it then I made a plan of what I should learn to develop this game. These are the steps involved in the plan…

1. Making a window using pygame ^
2. Adjusting scaling issues
3. Knowing how to move an object(which is on screen) using mouse
4. Display lines & blocks & balls ^
5. Function for picking a random quad from those 8 balls ^
6. Informing the user about his guess made ^
7. Check every time the no. of chances left ^
8. Make the first page of Master Minds with attractive animations ^
9. Event handling ^
10. Game end/ Game Won pop up ^
11. Check how many guesses made so that within the no. of guesses he finishes the game ^
12. Name the main function as Master_Minds ^

That ^ on the right indicates that it was done successfully . After making this plan I have learnt creating a window, captioning it, and drawing objects like rectangles, circles and triangles, after 2 days of progress, I have drawn this with adjusted positions and colors.

A pic during development

I know that games contains sprite images (blits) and here I need the balls, I have surfed web well for finding the necessary sprites, later I found a software to create our own sprites which is of no use as we need to have pixel knowledge for that. Thank god within a day I found solution for this, thanks to windows 3d paint, I have created all sprites with transparency effects using that tool the following pics will depict what I made.

Event Handling:

Now the most important part comes into picture, it is event handling I have handled all mouse motion events and key board events in the main game loop itself as I have learnt that all the functions are called once per an iteration so if we want the event to hit we must handle it in the main loop itself. I first thought of including mouse dragging and placing but later I have changed my idea as most of us use laptops and the precision pad, no one wanna use it for dragging. Thus I have handled all the necessary events.

Game main logic:

The main logic of the game is that for an instance of the game, There is a random quad generated, compare it with every guess the user have made, make a decision based upon on the comparison and display the hint to the player with orange and blue balls , they are displayed as a quad, but that doesn’t mean that the first ball is matched with the first hint eye, they are not interlinked and the player should not concentrate on how the hint is aligned, he/she should focus on whats there in the hint instead.

Conclusion:

I was so excited and elated in developing almost a practical project .

You can find the game code over here:

https://github.com/Praveenkumar789/Master_Minds