The main aim of this project is to create a GUI based pygame.
-
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
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
- 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
Dodger.2021-07-16.17-42-29.mp4
Rammya Dharshini K
None