Skip to content

Latest commit

 

History

History
83 lines (48 loc) · 2.06 KB

File metadata and controls

83 lines (48 loc) · 2.06 KB

Simulate Color Game

Aim

The main aim of the project to create a game using pygame module.

Purpose

The purpose of this project is to create a pygame for fun also increases the concentration

Short description of package/script

  • If standalone script, short description of script explaining what it achieves.

There are four colored buttons on the screen. The buttons light up in a certain random pattern, and then the player must repeat this pattern by pressing the buttons in the correct order. Each time the player successfully simulates the pattern, the pattern gets longer. The player tries to match the pattern for as long as possible.

  • List out the libraries imported.

    • pygame
    • random
    • sys
    • time

Workflow of the Project

  • 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
  • Calculating the Epoch Time
  • Drawing the Board to the Screen
  • Same Old terminate() Function
  • 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

Setup instructions

Install the python 2.8 or above

Install the pygame module using pip install pygame

Compilation Steps

Download the python code named simulate_color_game.py

Download the music for background.

Extract the files and keep both in same folder.

Run the code by double clicking them.

Enjoy the Game..

Output

Author(s)

Rammya Dharshini K

Disclaimers, if any

None