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.post6.tar.gz (62.9 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.post6-py3-none-any.whl (76.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: miniform-0.1.2.post6.tar.gz
  • Upload date:
  • Size: 62.9 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.post6.tar.gz
Algorithm Hash digest
SHA256 0e934889836daf3b38967683cf255f186b21783a78e98f4fae4533f8aa92ee11
MD5 513d5fd4fd786c62dec50c90774f2d15
BLAKE2b-256 8e0badfdcd672c175ed40d8504270da975542732a4c8c7ff473f4e3fe4d86f2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: miniform-0.1.2.post6-py3-none-any.whl
  • Upload date:
  • Size: 76.1 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.post6-py3-none-any.whl
Algorithm Hash digest
SHA256 3d6a6cffa49a84d31cb1d98b2c5f744df95d137b74e3eb57c69755703b38e0d4
MD5 6aac30d4930edb3acc98aac0231bcdb3
BLAKE2b-256 1c6f5fc71390670b61d5455ca6b04f1fb07d6bd7149b933afa34aa3f8d04f4bc

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