Skip to content

Willard21/MineKhan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

79fa39f · Jan 21, 2025
Jul 28, 2021
Jan 21, 2025
Jan 21, 2025
Apr 19, 2024
Jun 8, 2021
Jun 20, 2021
Jan 21, 2025
Dec 12, 2020
Apr 28, 2024
Apr 27, 2024
Apr 27, 2024
Nov 29, 2022
Apr 17, 2024

Repository files navigation

MineKhan

Minecraft for Khan Academy

Khan Academy link can be found here.

GitHub release can be found here.

Replit post and app

Multiplayer login and game. This is the most up-to-date version, and I frequently code in production on this version. Beware of bugs.

Texture encoder is here.

If you'd like to contribute, join the conversation on Discord.

To build the project, first clone/download it, then cd into the directory, then npm install, then node index.js. This will build the project into the dist folder and start a server on http://localhost:4000. It will watch for any changes in the src folder and automatically re-build the project as soon as you save.

Compiling the caves.c file into WASM is a bit more involved. It requires installing emscripten, then running emcc src/c/caves.c -o test.js -O3 -Os -sEXPORTED_FUNCTIONS=_getCaves -sERROR_ON_UNDEFINED_SYMBOLS=0, which will output a useless JS file along with the .wasm file. Delete the JS file. Then you'll need to convert the .wasm file to base64 somehow (I just googled an online tool for it), then copy/paste it into the workers/Caves.js file. Loading the wasm file directly works too, but that wouldn't work on KA, which is why I went with the base64 method.

I think there's a way to compile C into WASM with Clang to avoid emscripten and that useless JS file, but I couldn't figure it out. If anyone else figures it out, I'd appreciate some instructions.