obiwac / python-minecraft-clone

Source code for each episode of my Minecraft clone in Python YouTube tutorial series.
https://www.youtube.com/playlist?list=PL6_bLxRDFzoKjaa3qCGkwR5L_ouSreaVP
MIT License
162 stars 79 forks source link

How to change the block being placed and why there is only one chunk of world generated #70

Closed glowiak closed 1 year ago

glowiak commented 2 years ago

For the first one, I can only place The Slab,

for the second one, even if it's not the default one, the game loads only one chunk of the world

I saw on the videos that the world is bigger than just one chunk and placing other blocks.

obiwac commented 2 years ago

For the first one, I can only place The Slab

You can randomly change the block that you're holding by pressing the G key, or you can change what block you start off holding in the Game class' self.holding attribute. All of this should be relatively easy to see in the code (in this case main.py).

for the second one, even if it's not the default one, the game loads only one chunk of the world

It's actually loading 4 of them. You can change how many chunks are read from the save file in save.py. Otherwise, if you want something that "just works", I recommend you run the version in the community directory.

obiwac commented 1 year ago

Closing this issue :)