Skip to main content

miniworlds

miniworlds lets you create 2D mini worlds and games in Python: pixel-based scenes, tile worlds (e.g. rogue-likes), hex boards and processing-style graphics.

It is a 2D engine inspired by Greenfoot and gamegrid, based on Python 3 and pygame-ce (pymunk for physics). miniworlds is the successor of miniworldmaker.

Requires Python 3.10 or newer.

Installation

pip install miniworlds

pygame-ce and numpy are installed automatically.

First program

Two actors that are controlled with the keyboard:

from miniworlds import World, Actor

world = World(400, 400)
world.add_background("images/grass.jpg")

player = Actor((90, 90))
player.add_costume("images/player.png")
player.costume.orientation = -90

@player.register
def on_key_down_w(self):
    player.y = player.y - 1

player2 = Actor((180, 180))
player2.add_costume("images/player.png")
player2.costume.orientation = -90

@player2.register
def on_key_pressed_s(self):
    player2.y = player2.y - 1

world.run()

The images used above ship with the examples repository, see below.

Documentation and tutorials

Examples

Runnable examples (both short scripts and class-based programs) live in asbl/miniworlds_examples.

Sub-libraries

Library Install
miniworlds-robot pip install miniworlds-robot
miniworlds-data pip install miniworlds-data
miniworlds-physics pip install miniworlds-physics
miniworlds-turtle pip install miniworlds-turtle

Browser editor

miniworlds-editor is a browser app that runs miniworlds programs without installation (https://editor.opencoding.de/). Each editor project installs its engine version from PyPI, so a released version becomes available there automatically.

Development

See DEVELOP.md; tests run through the Docker-based Invoke tasks:

invoke tests.run
invoke build.docs

License

MIT, see LICENSE.txt. Media in the examples repository has its own licenses.

Metadata

Release files for miniworlds 4.4.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miniworlds 4.4.0.19
File Size Uploaded Provenance Actions
miniworlds-4.4.0.19.tar.gz 254.4 kB Without provenance Details for miniworlds-4.4.0.19.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for miniworlds 4.4.0.19
File Interpreter ABI Platform Actions
miniworlds-4.4.0.19-py3-none-any.whl Python 3 none any Details for miniworlds-4.4.0.19-py3-none-any.whl

Total release size: 570.4 kB

Release files / miniworlds-4.4.0.19.tar.gz

Download URL miniworlds-4.4.0.19.tar.gz
Size 254.4 kB
Tags Source
SHA-256 checksum
How to use checksums
958b4039852137141b77401eaf49aa9dddea9666c9bc36714d34daab713a3bd3
BLAKE2b-256 checksum
How to use checksums
b003ba3391490162ec0ef337a8d9ffb3d02e942db0a61d6b9d82ff208ba02785
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / miniworlds-4.4.0.19-py3-none-any.whl

Download URL miniworlds-4.4.0.19-py3-none-any.whl
Size 316.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5cc06553b475786b4debafa52c1fb65a6b8d213088af037ab9bdf3f5b4fbf3f
BLAKE2b-256 checksum
How to use checksums
c09fe87b580fed4d9ae7ba8f223f0bcc9c36366e79fa9d343aa0e4236fbc760f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for miniworlds 4.4.0.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.4.0.19 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page