Live data from Hacker News

Simple Minecraft Clone in 580 lines of Python

github.com

21–30 of 113 posts

Re: Simple Minecraft Clone in 580 lines of Python

#21
post #14

If someone were to make something like this a step-by-step tutorial/template appropriate for a classroom setting it would be huge. Imagine a class at High School where you start off learning the basics of Python for the first few weeks and the rest of the semester is spent writing the chunks of code into a template that has lots of notes for guidance. I'd image something like : def setDefaultBlockColor(color): # reca…

There's an awful LOT happening behind those 580 lines. I'm not sure whether it is a good thing to start at such an unrealistically high level of abstraction for a 3d game.

[deleted]

Re: Simple Minecraft Clone in 580 lines of Python

#22
post #18

These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines. How do people do this? How do their minds work?

It's all about standing on the shoulders of giants.

Re: Simple Minecraft Clone in 580 lines of Python

#23
post #18

These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines. How do people do this? How do their minds work?

It's all about standing on the shoulders of giants.

Well, that's certainly true when we're talking about the underlying 3D graphics libraries, IO, etc. But it seems like there's still a lot more to the rest of it, and that it shouldn't fit in 500 lines of code.

This one really gets me as well:

http://www.mojang.com/notch/j4k/l4kd/

Re: Simple Minecraft Clone in 580 lines of Python

#24
post #18

These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines. How do people do this? How do their minds work?

Take a look at the code, it's not THAT hard when you have the right tools (language, libraries, knowledge...) though it's quite awesome nonetheless.

IMHO the game actually shows how powerful Python + Pyglet (OpenGL actually) are.

Wanna get your mind blown even harder? Check some 4kb demos[1]... and that's binary size! No JVM/Python runtime supporting it.

[1] http://www.youtube.com/results?search_query=4kb+demo&pag...

Re: Simple Minecraft Clone in 580 lines of Python

#25

More than 100 lines of this are textures! Got this error though. Any ideas? OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime, 6): no suitable image found. Did find: /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture

Try running it using 32 bit Python vs 64 bit Python. It also depends on your OS. Which OS X are you on?

Re: Simple Minecraft Clone in 580 lines of Python

#27
post #15

Earlier quoted context omitted.

It was built with an old version of pyglet trying to run on 64bit python. Update.

Unless I'm just terribly mistaken, good luck getting pyglet to run on OS X right now. However, I really hope I am wrong, because that means I was just being a fool last week and will soon be using pyglet.

That's sad to hear - I ran in to that last week with pygame (can't run it in a 64 bit environment on OS X).

Re: Simple Minecraft Clone in 580 lines of Python

#28
post #18

These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines. How do people do this? How do their minds work?

Experience.

Code a lot. Write games a lot.

Re: Simple Minecraft Clone in 580 lines of Python

#29
post #14

If someone were to make something like this a step-by-step tutorial/template appropriate for a classroom setting it would be huge. Imagine a class at High School where you start off learning the basics of Python for the first few weeks and the rest of the semester is spent writing the chunks of code into a template that has lots of notes for guidance. I'd image something like : def setDefaultBlockColor(color): # reca…

There's an awful LOT happening behind those 580 lines. I'm not sure whether it is a good thing to start at such an unrealistically high level of abstraction for a 3d game.

Don't worry, it is a good thing. The ones who want to take it further will naturally start digging into what's going on behind the scenes.

Where would games be if we didn't have abstraction?

Re: Simple Minecraft Clone in 580 lines of Python

#30
post #24
post #18

These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines. How do people do this? How do their minds work?

Take a look at the code, it's not THAT hard when you have the right tools (language, libraries, knowledge...) though it's quite awesome nonetheless. IMHO the game actually shows how powerful Python + Pyglet (OpenGL actually) are. Wanna get your mind blown even harder? Check some 4kb demos[1]... and that's binary size! No JVM/Python runtime supporting it. [1] http://www.youtube.com/results?search_query=4kb+demo&pag...

If you want to show off the demoscene, try the 64KB prod "Chaos Theory".

https://youtu.be/4DjBq2O0XXk

Post reply on HN