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
class MyWorld(World):
def __init__(self):
super().__init__()
# Eine Funktion, die beim Drücken der B-Taste aufgerufen werden soll
def build_key_pressed(world:World):
print("B pressed.")
x,y,z = world.player_position()
# Neue Blöcke können mit setBlock gesetzt werden.
# Verfügbare Materialien stehen in World.MATERIALS und umfassen
# air, default:brick, default:stone, default:sand, default:grass
print("Block types", World.MATERIALS)
world.setBlock(x,y,z, "default:brick")
# Mehrere Blöcke auf einmal abseits des Spielers platzieren
x,y,z = x,y,z+3
world.setBlocks(x,y,z, x+3,y+3,z+3, "default:grass")
# Erstellen einer neuen Welt
my_world = MyWorld()
# Die Welt wird gestartet
my_world.run()
Quellen
Der Quellcode basiert auf dem Code von SensorCraft, der wiederum auf dem Code von Craft basiert.
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.4.tar.gz
(16.8 kB
view hashes)
Built Distribution
Close
Hashes for pyblockworld-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abbd0910751907f118444f241b1e902c5033368494a1892145aad5ccf2ee2511 |
|
MD5 | 4359ec6d4627ef47b1252b7a7cc9f079 |
|
BLAKE2b-256 | 5ae59cf38a705ad46d5f929bb85b86d44e7feeeab6247ef1788377b822de71e6 |