Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Dodger

Aim

The main aim of this project is to create a GUI based pygame.

Short description of package/script

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

    In the Dodger game, the player controls a sprite (the player’s character) who must dodge a whole bunch of baddies that fall from the top of the screen. The longer the player can keep dodging the baddies, the higher their score will get.

  • List out the libraries imported.

    • pygame
    • sys
    • random

Setup instructions

Download the python 2.8 or above

Install the pygame using the command - pip install pygame

Download the doger code file and also donload the images and sound for background purposes

Double click the code and Enjoy your game

Workflow

  • Import the required modules
  • Setting Up the Constant Variables
  • Defining Functions
    • Ending and Pausing the Game
    • Keeping Track of Baddie Collisions
    • Drawing Text to the Window
  • Initializing pygame and Setting Up the Window
  • Setting Up Font, Sound, and Image Objects
  • Displaying the Start Screen
  • Starting the Game
  • The Game Loop
    • Handling Keyboard Events
    • Handling Mouse Movement
  • Adding New Baddies
  • Moving the Player’s Character and the Baddies
  • Removing the Baddies
  • Drawing the Window
    • Drawing the Player’s Score
    • Drawing the Player’s Character and Baddies
  • Checking for Collisions
  • The Game Over Screen

Output

Dodger.2021-07-16.17-42-29.mp4

Author(s)

Rammya Dharshini K

Disclaimers, if any

None