Skip to main content

A neat little thing... with nightly updates

Project description

r3shape-labs
PyPi Package version
GitHub Stars License

r3frame is a collection of modules designed to bring structure to your next game project, without hindrance.

Installation

Install r3frame via pip:

pip install r3frame2

r3 Playground

Once installed, you can run the r3frame playground demo by typing:

r3 playground

This will launch an interactive example that is actively maintained and used to showcase r3frame's capabilities.

Quick Start

Getting started is as simple as the following code:

import r3frame2 as r3

class MyScene(r3.app.R3scene):
    def __init__(self, app):
        super().__init__(app)

    def init(self):
        # load an R3entity
        self.database.load_entity("player", [100, 100])
        
        # query said entity and toggle physics on it
        self.player = self.database.query_entity("player")
        self.physics.toggle(self.player)
    
    def exit(self): pass

    def events(self):
        # handle movement along the x-axis
        if self.app.events.key_held(self.app.keyboard.A):
            self.physics.set_velocity(self.player, dx=-100)
        if self.app.events.key_held(self.app.keyboard.D):
            self.physics.set_velocity(self.player, dx=100)

        # handle movement along the y-axis
        if self.app.events.key_held(self.app.keyboard.W):
            self.physics.set_velocity(self.player, dy=-100)
        if self.app.events.key_held(self.app.keyboard.S):
            self.physics.set_velocity(self.player, dy=100)

    def update(self, dt: float): pass

    def render(self):
        self.app.window.blit(self.player.surface.surface, self.player.pos)

class MyApp(r3.app.R3app):
    def __init__(self):
        super().__init__(title="MyApp")

    def init(self):
        self.add_scene("player", MyScene)
        self.set_scene("player")

    def exit(self): pass

MyApp().run()

Contributing

Want to help improve r3frame? Feel free to contribute by submitting issues, suggesting features, or making pull requests!

License

r3frame is open-source under the MIT License.

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

r3frame2-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file r3frame2-0.0.1.tar.gz.

File metadata

  • Download URL: r3frame2-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for r3frame2-0.0.1.tar.gz
Algorithm Hash digest
SHA256 58623d2997cb6412ab2e58b0456e7bbf61be28515a9e27d60226e168d5ec385c
MD5 6fe647de14fde0783c0036b282988535
BLAKE2b-256 1a55b3a9838ae49af6aec222c831b489c9666148bedf6434d0129ff2b8e93aee

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