To create a memory game.
The purpose of this project is to create a pygame for fun also increases the concentration
The program runs a memory game that allows you to turn over cards by clicking the mouse.
Copy the project to your local enviroment and that's all this code can be run on any python IDE.
- Importing the required modules
- Setting Up the Buttons for game
- The main() Function to execute all the functions in the program.
- Declaring Some Local Variables Used in This Program
- Drawing the Board and Handling Input for output window
- Checking for Mouse Clicks
- Checking for Keyboard Presses
- The Two States of the Game Loop
- Figuring Out if the Player Pressed the Right Buttons
- Reusing The Constant Variables
- Animating the Button Flash
- Drawing the Buttons
- Animating the Background Change
- The Game Over Animation
- Converting from Pixel Coordinates to Buttons
Download the python code named app.py
Extract the files and keep both in same folder.
Run the code by double clicking them.
Enjoy the Game..
- The program runs a memory game that allows you to turn over cards by clicking the mouse.
- Each grey box represents the image of an animal hidden by default.
- If there is a match, the two cards will disappear, leaving a blank white space and giving a message "MATCHED".
- If not, they will flip back over.
!
NO