Skip to main content

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!

Project description

Framex

A game engine built off of pygame-ce. Created specifically to spin up quick testing worlds or to make actual games.

Installation

pip install framex-ce

# This should auto install pygame-ce, if not, run
pip install pygame-ce

Usage

A starting window (500x500)

from Framex import *

loop = Loop(
    caption = "My First Framex Window",
    background_color = (15, 15, 15),
    size = (500, 500),
    frame_rate = 60
)

loop.run()

A Custom quit key

import pygame
from Framex import *

loop = Loop(
    caption = "My First Framex Window",
    background_color = (15, 15, 15),
    size = (500, 500),
    frame_rate = 60
)

loop.run(
    quit_key = pygame.K_q
)

A Simple player controlled Character

import pygame
from Framex import *

loop = Loop(
    caption = "My First Framex Window",
    background_color = (15, 15, 15),
    size = (500, 500),
    frame_rate = 60
)

groups = Groups(
    zorder = True
)

player = DynamicEntity(
    position = (50, 50),
    group_ref = groups,
    color = (0, 255, 0),
    center = True,
    player_controlled = True
)
groups.add_dynamic(player)

def draw_func(screen: pygame.Surface, camera: None | Camera):
    groups.draw(screen = screen, camera = camera)

def update_func(dt: float):
    groups.update(dt = dt)

loop.run(
    draw_func = draw_func,
    update_func = update_func,
    quit_key = pygame.K_q
)

Some static entities with a camera

import pygame

from Framex import *

l = Loop()

groups = Groups(True)

player = DynamicEntity(
    position = (50, 50),
    group_ref = groups,
    color = (0, 255, 0),
    center = True,
    player_controlled = True
)

x = 100
for _ in range(10):
    static_sprite = StaticEntity(
        position = (x, 100),
        group_ref = groups,
        color = (255, 0, 0),
        center = True
    )
    groups.add_static(static_sprite)
    x += 140

groups.add_dynamic(player)

def draw_func(screen: pygame.Surface, camera) -> None:
    groups.draw(screen, camera)

def update_func(dt: float | int) -> None:
    groups.update(dt)

camera = Camera("lerp")
camera.set_target(player)

l.run(
    draw_func = draw_func, 
    update_func = update_func, 
    camera = camera, 
    quit_key = pygame.K_q)

More Tutorials

Some more tutorials will be added here soon!

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.2.0.tar.gz (6.4 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.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: framex_ce-0.2.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for framex_ce-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6a814e7afbe1f9b25260cda767cf38948b2dddf8df43e5c95f1f9003578e8412
MD5 3c84716670738ad2e5559b5bf8028480
BLAKE2b-256 0ed6a3f153469d366589fc8bef872f56e40e09b172e968b325619ec172e46b04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: framex_ce-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for framex_ce-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79b51b471d62b0abea3bf6fe997ef60b384e349c45a1dca62b942754fcc51097
MD5 b815c0b3a2a8bc0e4310b314c27dacc0
BLAKE2b-256 0b1b19d6f8f2cd4047e1a16b9c016ece524682d4784d2c16c36475f65ecd1dd3

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