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.post4.tar.gz (60.5 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.post4-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: miniform-0.1.2.post4.tar.gz
  • Upload date:
  • Size: 60.5 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.post4.tar.gz
Algorithm Hash digest
SHA256 87abe8aa82ccf09b08d92409acc81b333d0744771bbe1aebd51707fe8ab36784
MD5 ffc7aa3ccdb80d21e2c8ebb5acce2a5a
BLAKE2b-256 9dea3a0dbbcb902bdd4cc890c7ebae9d8db7a51e7bf1a5d9c4ae9bec24e66ec9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: miniform-0.1.2.post4-py3-none-any.whl
  • Upload date:
  • Size: 70.3 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.post4-py3-none-any.whl
Algorithm Hash digest
SHA256 206f9b55d3cefc0ca39bba1d25969b4a3baeab19bf24c6d76ce0179cc031d891
MD5 6f337844db18375fe47eda5f8fee7db2
BLAKE2b-256 2a5ce5419e10cbd24d2963edf51cef099344fd104504eead948ac16c9e5c1cad

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