Skip to main content

Quick-start framework for pygame-ce prototypes

Project description

Framex

This is a python module that utilizes pygame-ce. It will just make creating quick test windows a lot easier + you will be able to use it just like a normal pygame window!

pip install framex

Example Uses

Little Red Box

import pygame
from Framex import *

# Create a Window
window = Framex(
    size = (500, 500),
    title = "Little Red Box",
    color = "Black"
)

# Create a little red box
image, rect = create_object(
    image = None,
    pos = (250, 250),
    center = True,
    size = (50, 50),
    srcalpha = True
)
image.fill("Red")

# Get all the items to draw
items = [(image, rect)]

# Game Loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
        
    window.update(items = items)

Top Down Character

import pygame
from Framex import *

# Create a window
window = Framex(
    size = (500, 500),
    title = "Top Down Character",
    color = "Black"
)

# Create a clock for dt
clock = pygame.time.Clock()

# Create a top down character
sprites = pygame.sprite.Group()

character = TopDownEntity(
    image = None,
    pos = (250, 250),
    group = sprites,
    color = "red",
    center = True,
    size = (50, 50),
    srcalpha = True,
    movement_type = "WASD",
    speed = 250
)

# Get all the items to draw
items = [(character.image, character.rect)]

# Game Loop
while True:
    dt = clock.tick() / 1000

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
    
    sprites.draw(window.screen)
    sprites.update(dt)

    window.update(items = items)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

framex_ce-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

framex_ce-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file framex_ce-0.1.0.tar.gz.

File metadata

  • Download URL: framex_ce-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for framex_ce-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fd06abdee8dfafa8bd070a6b6de4a1b4eb84dd944526e2ef18753cec1671959
MD5 8af81c29d5f7e439f83c14de20627911
BLAKE2b-256 d69b296d7250c55433acebe4d592e0e6bada7de115f5e898675a9396fc2e1259

See more details on using hashes here.

File details

Details for the file framex_ce-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: framex_ce-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for framex_ce-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dac2d7076d14a24fcdcc6e46637724718bc7a92f9cf550a8680cb2f5703315fa
MD5 83c5e9ff711862763a86a15c2bfecf05
BLAKE2b-256 fd9308d45fe1bae073f53a83e0b0762740c90ee40663b16d3e5fa33728d22deb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page