Thanks. My son has been asking me how to write games, and has spent some time looking around in the code for the Raspberry Pi version of Minecraft. Maybe we can make some headway in this version because even dumb old Dad can handle 500 lines.
HTML5 games! They're easy, quick to set up, the feedback is instant and they're fun to play! I've been making HTML5 games as part of short, two hour collaborative coding exercises at work and it's awesome. Here's a recent one we did based on Flappy Bird [1]. I made a few bootstrap scripts here [2] to make it easier to get up and running. 1. https://github.com/hoorayimhelping/Flabby-Bird 2. https://github.com/hoorayim…
Minecraft clone in Python with Pyglet
31–40 of 43 posts
Re: Minecraft clone in Python with Pyglet
#32Why is it called "Minecraft in 500 lines of Python" when the slides mention 8000 lines?
The original project[1] was a very simple 500 line implementation of Minecraft. There is a fork[2] of that project with 8000 lines of code and many more features. [1] https://github.com/fogleman/Minecraft [2] https://github.com/boskee/Minecraft
Re: Minecraft clone in Python with Pyglet
#33The Python clone I wrote is pretty cool and minimal, but I'm much more proud of a clone I later wrote in C:
https://github.com/fogleman/Craft
This one is much more performant and has way more features, including online multiplayer. The server is in Python.
Here's a video of it:
https://www.youtube.com/watch?v=tScCneiTGm4
Anyway, happy to answer any questions.
Re: Minecraft clone in Python with Pyglet
#34Re: Minecraft clone in Python with Pyglet
#35Earlier quoted context omitted.
Yes, this 500 lines statement is somewhat misleading. This program isn't written on Python, rather on a large specific library which does a lot of heavy lifting. It's better than nothing, though, to be able to look at an app dissected even to a few large blocks. Kudos.
When there are libraries to do the heavy lifting for you, I would still say that the 500 lines is rather accurate. I have never taken the "X lines of code" to refer to all the libraries included, but rather to the lines of code necessary for a new user to write in order to make something that works. I agree that it can be distorted, by defining everything as an external library, but it does give a good measure of how…
In this example a lot was done in the external library which was imported. The rest is a little bit of Python with crucial use of those facilities offered by imported library. So I'd say it's not Python - by much - which this program is written on. But that's just a definition - I find it useful to define it this way, but it's certainly not the only possibility.
Re: Minecraft clone in Python with Pyglet
#36What bothers me here is that people claim to program "Minecraft in X lines", when in fact all they create is a block (voxel) game engine. Minecraft is much more than that, it has redstone circuits, farming, mobs, structures, biomes, potion brewing, netherworld, fire, etc... Mind you, I don't want to belittle anyone's efforts. I think this is an awesome programming project. But its description is misleading.
Don't forget that Minecraft was originally just a game where you could walk around and place or destroy blocks. None of the fancy stuff you're talking about was added until the game started taking off.
Re: Minecraft clone in Python with Pyglet
#37Re: Minecraft clone in Python with Pyglet
#38Has anyone heard of Bravo? It's actually minecraft in python... https://github.com/bravoserver/bravo
Re: Minecraft clone in Python with Pyglet
#39Original author here. Saw a lot of traffic to my GitHub repo and wondered where it was coming from. The Python clone I wrote is pretty cool and minimal, but I'm much more proud of a clone I later wrote in C: https://github.com/fogleman/Craft This one is much more performant and has way more features, including online multiplayer. The server is in Python. Here's a video of it: https://www.youtube.com/watch?v=tScCneiTG…
Re: Minecraft clone in Python with Pyglet
#40Original author here. Saw a lot of traffic to my GitHub repo and wondered where it was coming from. The Python clone I wrote is pretty cool and minimal, but I'm much more proud of a clone I later wrote in C: https://github.com/fogleman/Craft This one is much more performant and has way more features, including online multiplayer. The server is in Python. Here's a video of it: https://www.youtube.com/watch?v=tScCneiTG…
Why did you choose to store the state in a database? It seems like an unusual choice for a game.