← All Workshops

MudEngine Part 4: Single-Player Dioxus GUI

From REPL to GUI

In Part 2 we built a pure Rust REPL that runs in the terminal. The game engine — a World struct with rooms, descriptions, and movement — is independent of any UI layer.

In this part we lift that same engine into a Dioxus GUI. Instead of printing to stdout and reading from stdin, we render:

  • A 3×3 grid showing all rooms in the world, with the current room highlighted
  • A description panel that shows the current room name, description, and exits
  • A command input where the player types navigation commands

The engine logic stays the same. Only the interface changes.

This design — engine separate from UI — is what lets us later replace the GUI with a network protocol for multiplayer.

"🖥️ Dioxus GUI" "⚙️ Game Engine" "triggers go/look" Vec — 9 rooms arranged in 3×3 grid player_room: usize current position look() → formatted String go(dir) → bool move if exit exists WorldGrid component reads World, renders grid Description panel shows current room Input box keyboard handler