Roguelike Dice Game

Completed: 2026-01-01

A web-based version of a dice-rolling roguelike inspired by Balatro and Farkle

After building a CLI-only version of a dice-rolling roguelike, my next challenge was to create a web-based version without breaking the CLI version or rewriting core game logic.

After severely over-engineering my game engine's type safety, I started this iteration by flattening my file structure, refactoring game logic, and building a working roguelike progression system.

Once the core CLI game was once again playable, enjoyable, and even somewhat "finished", I took another swing at implementing a web version - and was shocked to see how quickly and cleanly I got it working. Better GameState management definitely helped, and I had also come a lot closer to having a game engine running exclusively on pure functions.

From there, I was able to rapidly introduce new game mechanics and content, and it was starting to feel like an actual roguelike game.

However, I had somewhat left the CLI version in the dust, so I decided to implement a GameAPI, which could be used with the CLI, web, and any future implementations without burdening the code down with too much implementation-specific code. This way, the WebGameManager exclusively interacted with the GameAPI and never needed to import or use anything directly from the game engine. This refactor also made me realize that I needed to clean up my game logic and functions, so I made GameAPI the "orchestrator" of different game interactions, i.e. it essentially calls a function for each step of a major game action like "Scoring", and each group of related functions (e.g. charms.ts, consumables.ts) have their own file where they are organized and kept pure.

While the GameAPI refactor was pretty brutal and almost cracked me several times, it again paved the way for a deluge of new game mechanics and content. It was at this point that I created a document called content-polish.md, which would serve as the basis of the next 25+ major pull requests of this project, taking Rollio from a basic dice-rolling game to a fully-built roguelike world.

Technologies Used

  • TypeScript (core logic and type safety)
  • React (frontend)
  • Node.js & Express (API + server)