Show HN: Teachcraft – Learn Python through Minecraft
51–60 of 64 posts
Re: Show HN: Teachcraft – Learn Python through Minecraft
#52Nice! A while ago, I also worked on a Python Minecraft interaction which is not based on mcpi (and RaspberryJuice), but instead spawns a full Jython based Python interpreter session server-side allowing you to directly use the full Bukkit API [1]. This allows to use various commands mcpi doesn't support, such as creating lightning, explosions, and dynamically writing events using Python, either by using a client (sen…
Wow! I believe this is exactly what I've been looking for. One of my goals is to get my son, who is really into Minecraft, also interested in programming. The github project seems to be receiving updates too. If I end up making some reasonable progress on this, I might just contact you later on, if that's ok with you!
At one point, I plan to experiment with ZipPy (https://github.com/securesystemslab/zippy) to see if that would be a viable option to get Python 3 support underway.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#53Any parents here have any success inspiring their child to code who was averse to it? I've tried scratch, tynker, roblox, etc without much luck.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#54Any parents here have any success inspiring their child to code who was averse to it? I've tried scratch, tynker, roblox, etc without much luck.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#55Looks like a great guide to get started with coding with Minecraft. There have been some efforts over the years, but this looks really complete. One obstacle for schools to get started with this however, is buying all the Minecraft licenses. To this end, I've been toying around a bit with an open source Minecraft clone called Minetest lately [1][2]. It's surprisingly complete, and could also have great uses in (progr…
It was also great when he realized he didn’t need a superman command to fly because the combo of hulkjumping while flash was active made flying unnecessary.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#56Any parents here have any success inspiring their child to code who was averse to it? I've tried scratch, tynker, roblox, etc without much luck.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#57Front page has example code of a busyloop with a time.sleep. Not a stellar example of coding.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#58Seeing stuff like this is really cool. Adding more to the community and growing opportunity.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#59Looks like a great guide to get started with coding with Minecraft. There have been some efforts over the years, but this looks really complete. One obstacle for schools to get started with this however, is buying all the Minecraft licenses. To this end, I've been toying around a bit with an open source Minecraft clone called Minetest lately [1][2]. It's surprisingly complete, and could also have great uses in (progr…
This was on HN a while back, using Minetest for education: http://www.ocsmag.com/2016/04/04/mining-for-education/ My 5yo son has been playing Minetest for a number of months now and loves it. He has asked for certain features---e.g. having fire truck be able to shoot water to put out fires rather than having to get out and use buckets of water---and I intend to walk him through adding that feature and others as he ge…
Thanks! This is the type of actionable anecdata that I can use. I wasn't sure if it was too early to introduce my children to Mine[craft|test] at such an early age, but glad to hear that it's encouraging discourse and inquiry.
Re: Show HN: Teachcraft – Learn Python through Minecraft
#60Earlier quoted context omitted.
Regarding Emscripten, tried a while back to port "Craft" (lightweight Minecraft in C). Proved it could work but needs some work! :-D https://github.com/cjdell/Craft/commit/c0162acb36ed8f538c6bf... See it working here: http://wb.buz.co/craft/main.html In the end I ended up making this instead from scratch: http://webblocks.uk/ I might return to it though because my version isn't as functional! I
Looks good. Craft is simple enough to easily port to Emscripten. Another port of Craft I found a while ago is NetCraft: https://github.com/satoshinm/NetCraft
For those curious, https://github.com/satoshinm/NetCraft is my first project with WebAssembly/emscripten. It was surprisingly easy to port from Michael Fogleman's Craft (https://github.com/fogleman/Craft/). I briefly tried porting a few other open source block-style engines without success, but Craft being written in plain C with only a few libraries is relatively straightforward.
The initial requirement is to refactor the main loop, from while(1) to emscripten_set_main_loop, a common step for most all emscripten ports. Then update the cmake build file to build with the Emscripten.cmake module, and you're almost done. Emscripten's GLFW3 wrapper covers nearly all of Craft's usage. I posted a fairly minimal pull request showing the basic changes needed: https://github.com/fogleman/Craft/pull/175
After that, the other major change is networking. Craft used a separate thread to listen for network data using blocking sockets and parse message boundaries. But on the web platform with WebSockets, networking is even easier, I use emscripten_set_socket_message_callback() to get called when a new, complete message arrives. Easy as pie.
The harder part is the remaining long tail of minor bugs. At this point, the web port of Craft was functional, but difficult to play, a death by a thousand cuts. Emscripten's GLFW implementation had a few bugs related to cursor focus and keyboard handling, but I developed test cases and submitted fixes (https://github.com/satoshinm/emglfwbugs), which were all merged into emscripten's incoming branch. Until they were merged I built against a patched emscripten.
If anyone wants to get their hands dirty with emscripten, I highly recommend it. You can write the game in C, but the APIs are bridged to JavaScript, and it was fun to extend it and add new API for HTML5 platform features. I implemented the glfw joystick API (https://github.com/kripken/emscripten/pull/5175) on top of the HTML5 Gamepad API, and drop callbacks on top of the HTML5 File Drop API (https://github.com/kripken/emscripten/pull/5206), and started but have yet to finish the glfw monitor API on top of the HTML5 Screen API (which reminds me I ought to finish https://github.com/kripken/emscripten/pull/5205...). This means existing games written using GLFW (a popular multi-platform library for OpenGL, see http://www.glfw.org) with these features should port to the web using emscripten automatically.
After the web port, I continued to enhance https://github.com/satoshinm/NetCraft merging open pull requests from https://github.com/fogleman/Craft and developing new features and fixes. Blocks no longer break instantly, but instead are mined by holding down the mouse button, drawing a growing block break indicator until it breaks, and so on. Up until last month, recently taking a break (to investigate a few other, semi-related projects). However, it is still very playable in the current state.
A live demo can be found at https://satoshinm.github.io/NetCraft/, but the more interesting possibility in my opinion is multiplayer. Craft's original Python server backend can be connected to over the web (/server servername), using a websocket proxy, but I also wrote a Bukkit plugin to bridge a small chunk of the Minecraft world: https://github.com/satoshinm/WebSandboxMC. Last month I ran a server on a VPS (for 1 month), backed by a variant of the open source Glowstone server (https://github.com/GlowstoneMC/Glowstone), with this custom plugin and it peaked at a couple dozen users, running decently smooth. I also experimented with hosting on Heroku, it is less stable and deletes when the dyno shuts down, but works (for a smaller number of users): http://netcraft.herokuapp.com
I don't know if Craft is the answer, but I definitely agree, a web-based block style game is extremely appealing. The next major missing piece I see is extensibility, allowing outside developers to conveniently and cleanly create and distribute new content. Minetest is way further in this regard, I have not looked into it, but at least the filesystem and networking should be feasible to port to emscripten (emscripten has its own virtual filesystems), and shared memory may benefit from the upcoming SharedArrayBuffer technology: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...