A basic game built using Python's pygame library.
-
You should first fork the repository or clone it directly from here with the following command:
git clone <repository_url>
-
cd
into the directory where the game has been cloned and install thepygame
library withpip
. If you don't have pip, installpip
first. The command is as follows:pip install pygame
-
Run the game with
python shootinggame.py
on Windows orpython shootinggame.py
on Linux. -
A customized pygame window will pop up and you can play the game now. Yay!
-
The player is present at the bottom of the screen and the enemies appear from the top.
-
The player can only move horizonatally. Use the arrow keys to move the player.
-
The player has to shoot at the enemies by hitting spacebar.
-
One point is scored for every enemy hit.
-
The bullet streak moves in a straight line from the player. You have to aim at the enemies to target.
-
Enemies respawn on being shot.
-
Once the player is hit, it's game over for you.
-
The score is displayed on the top left of the pygame screen.