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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for pyblockworld-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91a561bb98fdd329366316fd221c5bd357a62e56da433ed364bb40befac84a83 |
|
MD5 | b2f11941f919c25041c9dae72e29092b |
|
BLAKE2b-256 | 59caf3a5ba5e365e861a5e15e06bd195beade0a0bfe03e06c607960350bb7adf |