← All Workshops

MudEngine Part 2: Single-Player REPL

Step 4 / 10

From Dioxus to the engine

In Part 1 we set up a Dioxus + WASM environment. This part takes a different direction: no Dioxus, no browser, no WASM. We build a pure Rust binary that runs in the terminal.

Why? The game engine is independent of the UI. By building a REPL first we focus on the core architecture — world state, command parsing, and descriptions — without the complexity of a web frontend. In later parts we will layer Dioxus on top as a graphical client.

What we build:

  • A World model with rooms, descriptions, and exits
  • A REPL loop that reads commands and prints responses
  • Commands: look, north/south/east/west, help, quit
  • A small 3-room world to explore
1. Read a line from stdin 2. Split into command + args 3. Dispatch to handler fn 4. Update world state 5. Print result to stdout
Step 4 / 10