Skip to main content

A neat little thing... with nightly updates

Project description

miniform Logo

Miniform

Version
GitHub Stars License
Build

What?

miniform is a game development framework designed to help developers create more with less hassle. It provides a structured foundation for handling Worlds, objects, UI, input, and rendering, so you can focus on making games instead of reinventing the wheel.

Why?

  • Save Time – No need to build a game structure from scratch.
  • Better Organization – Worlds, assets, and objects are neatly managed.
  • Pygame, but Better – All the flexibility of Pygame, with added convenience.

Content?

  • Modularity – Manage your game with a clean and modular API.
  • World & Object Management – Easily define and swap worlds.
  • Custom UI System – Interface-scripting made simple.
  • Asset Loading – Load sprites and animations efficiently.
  • Input Handling – Keyboard and mouse events with built-in support.
  • Partitioning Systems – Efficient object management for game worlds of any size.

Download?

Install miniform via pip:

pip install miniform

Getting Started?

After youv'e installed miniform go ahead and create a script named main.py somwhere and paste in the following code:

import miniform

class MyWorld(miniform.resource.world.MiniWorld):
    def __init__(self, app):
        super().__init__(
            app,
            miniform.resource.world.MiniTilemap(self, [32, 32]),
            miniform.resource.world.MiniGridPartition(app, self, [32, 32])
        )

    def init(self) -> None:
        self.player = self.load_object("player-1", size=[16, 16], pos=[100, 100], mass=800, static=0)

    def update_hook(self, dt: float) -> None:
        if self.app.events.mouse_wheel_up:
            self.app.camera_proc.zoom(-2.5)
        elif self.app.events.mouse_wheel_down:
            self.app.camera_proc.zoom(2.5)
        
        speed = 200.0
        if self.app.events.key_held(self.app.keyboard.W): self.player.set_velocity(vy=-speed)
        if self.app.events.key_held(self.app.keyboard.A): self.player.set_velocity(vx=-speed)
        if self.app.events.key_held(self.app.keyboard.S): self.player.set_velocity(vy=speed)
        if self.app.events.key_held(self.app.keyboard.D): self.player.set_velocity(vx=speed)
        
        self.app.camera_proc.move_to(self.player.pos)

    def render_hook(self) -> None:
        if self.app.events.mouse_held(self.app.mouse.LeftClick):
            self.app.render_proc.draw_line(self.player.center, self.app.mouse.pos.world, [0, 0, 255])
            self.app.render_proc.draw_circle(self.player.center, 4, [0, 0, 255])
            self.tile_map.set_tile(self.app.mouse.pos.world, 1)
        elif self.app.events.mouse_held(self.app.mouse.RightClick):
            self.app.render_proc.draw_line(self.player.center, self.app.mouse.pos.world, [255, 0, 0])
            self.app.render_proc.draw_circle(self.player.center, 4, [255, 0, 0])
            self.tile_map.rem_tile(self.app.mouse.pos.world)

class MyApp(miniform.app.MiniApp):
    def __init__(self) -> None:
        super().__init__("PlayGround")

    def init(self) -> None:
        self.set_world(MyWorld)

    def exit(self) -> None: pass

    def update_hook(self, dt: float) -> None: pass
    def render_hook(self) -> None: pass

MyApp().run()

| NOTE: The methods init(), exit() must be defined for any instance of MiniApp; a NotImplementedError is raised otherwise.

Above is a simple MiniApp + MiniWorld set up for topdown movement/runtime tilemap edits. From here you can explore the MiniStaticObject, MiniDynamicObject and the other classes provided in miniform.core.resource and miniform.core.resource.interface.

Contributions?

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

License

miniform 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

miniform-0.1.2.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

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

miniform-0.1.2-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

Details for the file miniform-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for miniform-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dca223df423fe7dae1a40853b987a4c1e18be22b35b92222cef36f35e8597716
MD5 2d97b9510e8f5320b656996623469354
BLAKE2b-256 36e6e343e1018f8fe2c75b90299e3740907bec033d95aa21c8ebed1ce789ef15

See more details on using hashes here.

File details

Details for the file miniform-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: miniform-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 48.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for miniform-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b1026982f895531b1283d0db89db257e87ccb0d32ed1d6b798b828732e31c13
MD5 51d889480fa7a2361fc58fcc28fc5d73
BLAKE2b-256 b91f6cd2262d6e457f7731606622260abf68c5c294d6166590e6df37cd872610

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