Skip to main content

Minecraft like Block world in Python

Project description

PyBlockWorld

Eine an Minecraft angelehnte Welt aus Blöcken.

Installation

Die Installation erfolgt über pip install pyblockworld.

API

    from pyblockworld import World

    # Eine Funktion, die beim Drücken der B-Taste aufgerufen werden soll
    def b_key_pressed(world:World):
        print("b pressed. player at", world.player_position())
        x,y,z = world.player_position()

        # Neue Blöcke können mit setBlock gesetzt werden
        # Verfügbare Materialien stehen in World.MATERIALS
        print("Block types", World.MATERIALS)
        world.setBlock(x,y,z, "default:brick")

        # Mehrere Blöcke auf einmal setzen
        x,y,z = x,y,z+3
        world.setBlocks(x,y,z, x+3,y+3,z+3, "default:brick")
        
    world = World("DEMO WORLD")
    # Die Funktion für die build-Taste (b) wird zugewiesen
    world.build_key_function = b_key_pressed
    # Die Welt wird gestartet
    world.run()

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

pyblockworld-0.2.1.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

pyblockworld-0.2.1-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page