Developed since June 15, 2025
GamePie is a simple library for creating 2D games using the pygame library.
It works on MS Windows and Linux (possibly macOS).
- Download the library files.
- Open the folder in your terminal. ( cd /home/ruda/Dokumenty/Python/gamepie )
- Install using:
pip install .python -m venv venv
source venv/bin/activate
pip install .python -m venv venv
source venv/bin/activate
python <name>.pygamepie.Window
Creates the main game window.
Arguments:
title: Window titleflags: Window flags (e.g.,gamepie.utils.RESIZABLE)
gamepie.Camera
Handles camera position, zoom, and anchor for rendering.
gamepie.load.Texture(path)
Loads an image texture from assets.
gamepie.load.Frames(path)
Loads animation frames from assets.
gamepie.draw.Animation
Rendering object
Draws and animates a sprite on the surface.
Arguments:
surface: Target windowposition: (x, y) coordinatesframes: Animation framesms: Frame duration in mssize: (width, height)camera: Camera objectanchor: Anchor position
gamepie.draw.gui.Label
Rendering object
Draws a text label on the surface.
Arguments:
surface: Target windowposition: (x, y)font: Font objecttext: String to displaybackground_color: Background coloranti_aliasing: Booleancamera: Camera objectanchor: Anchor positionvisible: Boolean
gamepie.draw.Image
Rendering object
Draws an image on the surface.
Arguments:
surface: Target windowtexture: Texture objectposition: (x, y)size: (width, height)camera: Camera objectanchor: Anchor position
gamepie.draw.Rectangle
Rendering object
Draws a rectangle.
Arguments:
surface: Target windowposition: (x, y)size: (width, height)color: RGB tuplecamera: Camera objectanchor: Anchor position
gamepie.draw.Ellipse
Rendering object
Draws an ellipse.
Arguments:
surface: Target windowposition: (x, y)size: (width, height)color: RGB tupleanchor: Anchor position
gamepie.draw.polygon
Rendering funcion
Draws a polygon.
Arguments:
surface: Target surfacecolor: RGB tuplepoints: List of (x, y) tupleswidth: Line thickness (0 = filled)angle: Rotation angleflip: (flip_x, flip_y)
gamepie.draw.line
Rendering funcion
Draws a line.
Arguments:
surface: Target surfacecolor: RGB tuplestart_pos: (x, y)end_pos: (x, y)width: Line thicknessanti_aliasing: Booleanblend: Booleanangle: Rotation angle
gamepie.utils.Objects
Groups multiple drawable objects for batch operations.
gamepie.utils.Namespace
Stores and manages game state variables.
gamepie.mixer.Sound
Loads and plays sound effects.
gamepie.load.Font
Loads a font for text rendering.
import gamepie
surface = gamepie.Window(title="Test", flags=gamepie.utils.RESIZABLE)
fps = gamepie.Clock(60)
pie_texture = gamepie.load.Texture("pie")
pie = gamepie.draw.Image(surface, texture=pie_texture)
def update():
dt = fps.tick()
speed = 0.1 * dt
pie.x += speed
surface.fill(gamepie.WHITE)
pie.draw()
surface.flip()
surface.run()
gamepie.quit()Quick use:
import gamepie
# Direct access to main objects
win = gamepie.Window(...)
cam = gamepie.Camera(...)
rect = gamepie.draw.Rectangle(...)
img = gamepie.draw.Image(...)
label = gamepie.draw.gui.Label(...)
controller = gamepie.plugins.Controllers.PlatformController(...)
sound = gamepie.mixer.Sound(...)
font = gamepie.load.Font(...)
objects = gamepie.utils.Objects(...)
namespace = gamepie.utils.Namespace(...)
color = gamepie.utils.Color("SKY")()- for more informacion write in terminal
python -m gamepie.commands.help
- Install plugins from local folders or git URLs using
install(path_or_url). - Uninstall plugins by name using
uninstall(name). - Plugins must contain a
.gppluginfile at the top level.
For more examples, see the src/ folder and the examples.py file.
Made by Rudolf Mueller