This is a basic boilerplate for a Pygame application. It provides a simple framework to help you get started with Pygame, including basic event handling, a game loop, and rendering.
- Initialization of Pygame and its mixer.
- A simple event handling system to manage quitting the application.
- A main game loop that updates and renders the application at a specified frame rate.
- Customizable colors through a
Colors
class.
- Python 3.x
- pygame
- Clone this repository:
git clone https://github.com/kstzl/pygame-boilerplate
cd pygame-boilerplate
pip install pygame
- Edit the
pygame_boilerplate.py
file. - Modify the window width, height, title, and FPS as needed:
app = PygameApplication(
window_width=600,
window_height=600,
window_title="Application Name",
fps=60
)
- Run the application
python pygame_boilerplate.py