Skip to content

mscbuild/game-shooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Top-Down Shooter (modern 2D shooter) under Windows

Creating a 2D top-down shooter in Python is done using the Pygame library, which provides built-in tools for working with graphics, sound, and input handling. Pygame: The industry standard for Python 2D game development.

modern 2D shooter

Game Loop:

  • Events: Listen for keypresses and clicks.
  • Logic: Move the player and update the coordinates of all bullets in the list.
  • Rendering: First, clear the screen, then draw objects.
  • Optimization: Bullets that fly outside the window are removed from the bullets list to prevent the program from slowing down after 5 minutes of play.

Suggestions for improvement:

  • Difficulty levels: Make enemies move faster or increase their numbers over time.
  • Health: Instead of instant death, add a health bar.
  • Bonuses: Make enemies drop health packs or rapid fire abilities.

How to turn this into .EXE (for Windows):

To send a game to a friend, install the pyinstaller library:

pip install pyinstaller

And in the terminal in the game folder, enter:

pyinstaller --onefile --noconsole game.py

Advice

If you're planning on creating a complex interface (many windows, settings, and lists), check out the pygame-gui library. It allows you to add text fields, drop-down lists, and Windows-style buttons.

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages