MCPcopy Index your code
hub / github.com/aykamko/minecrust

github.com/aykamko/minecrust @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
190 symbols 334 edges 20 files 11 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Minecrust ⛏️

A Minecraft clone that runs in the browser, written from scratch in Rust.

Works on desktop and mobile.

Try it out: https://aykamko.github.io/minecrust

Why?

This project is primarily for learning and proving to myself that I can write a game engine from scratch. Furthermore, I wanted to learn Rust, make the game easily accessible in the browser, and make it presentable like a real product.

As for my motivation, I've always had a deep respect for game developers. I used to believe that games and graphics were a dark art accessible only to a select few. But then I learned a bit about graphics from my work at Mighty, and I got inspired by jdh on Youtube who wrote his own Minecraft clone. I started to think, "Whoa, this isn't a dark art. I can do this too!"

Cool Features

  • Infinite, procedurally generated terrain. Dynamic memory management to achieve infinite world
  • Physics simulation and collision detection for the playable character
  • Custom shaders for shadows, diffuse reflection, and specular reflection
  • It's fast. Profile-guided optimization to achieve >30 FPS on most phones and laptops
  • A single Rust codebase that runs on all platforms: Web and Native (MacOS, Windows, Linux). Huge thanks to wgpu and wasm-pack for enabling this
  • ~~Beautiful~~ Custom artwork by yours truly
  • You can build a house in it 🏠
  • "Completed" in ~100 hours, but non-consecutively. 60% Summer 2022, 20% Winter 2022, 20% Winter 2023

How to Run

Native App

cargo run --release

Web App

yarn start

Things to improve that I will realistically never do

  • Increase draw distance on mobile
  • Probably need to implement view-frustum culling for this to be feasible
  • Camera movement with external mouse feels very sensitive, could use smoothing
  • Ability to save the world and load it up later
  • Better shadows
  • Antialiasing
  • Draw at a further distance
  • More block types
  • Better terrain generation
  • Ability to choose a different seed so terrain is generated differently
  • Better art? lol

Extension points exported contracts — how you extend this code

TimeTrait (Interface)
Borrowed from https://github.com/tuzz/game-loop [2 implementers]
src/game_loop.rs
DimOrder (Interface)
(no doc) [2 implementers]
src/vec_extra.rs

Core symbols most depended-on inside this repo

speed
called by 16
src/camera.rs
send_dom_controls_user_event
called by 14
src/dom_controls.rs
get_chunk_mut
called by 13
src/world.rs
get_raw_ptr_mut
called by 11
src/vec_extra.rs
get
called by 7
src/world.rs
get_block
called by 7
src/world.rs
isTouchDevice
called by 5
ts/index.ts
set
called by 5
src/world.rs

Shape

Method 101
Class 41
Function 41
Enum 5
Interface 2

Languages

Rust95%
TypeScript5%

Modules by API surface

src/world.rs57 symbols
src/dom_controls.rs19 symbols
src/game_loop.rs18 symbols
src/camera.rs18 symbols
src/lib.rs17 symbols
src/vec_extra.rs13 symbols
ts/index.ts8 symbols
src/vertex.rs8 symbols
src/light.rs7 symbols
src/wasm_utils.rs4 symbols
src/spawner.rs4 symbols
src/instance.rs4 symbols

For agents

$ claude mcp add minecrust \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact