I built a JavaScript game without a game engine

javascript dev.to


I’ve been working on a desktop fantasy story-based game called The Atlas Six, built entirely with JavaScript, without using a traditional game engine.

What started as a small idea turned into a full project where I ended up building my own lightweight “engine” around how the game runs.

At its core, the game is driven by a JSON-based structure. The entire story, choices, and events live inside structured data files. The main loop is essentially a recursive function that reads through story.json, renders content, and triggers custom events depending on what the player does.

Those events handle things like:

  • branching dialogue and story progression
  • starting battles
  • updating player stats and flags
  • triggering mini-games
  • switching scenes and UI states

It’s simple in concept, but scales nicely as the story grows.

Tech stack

  • JavaScript (frontend logic + systems)
  • Electron.js for running as a desktop app
  • Node.js (fs) for save/load functionality
  • JSON for story, items, and game configuration

Saves are handled through the file system rather than localStorage, which made it easier to manage multiple save slots and persist data cleanly.

Some of the systems I built

Character Creator
Stat-based system with classes and progression. This feeds directly into gameplay decisions, dialogue checks, and combat.

Branching Story Engine
Everything is choice-driven. Player decisions are tracked through flags and values, which influence future branches and outcomes.

Turn-Based Battle System
Inspired by games like Slay the Spire and Gwent. It uses a card-style approach with abilities, effects, and resource management.

Inventory System
Items are tracked and can influence story outcomes. For example, finding something like a “bloody knife” can unlock new dialogue paths or affect major decisions.

Skill Tree System
Multiple archetypes with expandable paths. Still evolving, but already integrated into combat and progression.

How it actually runs

Most of the game comes down to something like:

load a branch from JSON
render text + UI
check conditions
trigger events if needed
move to the next branch

Repeat.

It’s basically a controlled loop of reading structured data and reacting to player input.

Why I built it this way

I wanted to understand how far I could push JavaScript outside of typical web apps. Also wanted full control over how systems interact instead of relying on an existing engine.

It’s not perfect. Performance still needs work and I’m constantly refactoring parts of it. But building everything from scratch forced me to think about structure, scalability, and state management in a way tutorials don’t really teach.

Current state

The game is still in development and being actively refined. New systems are being added while older ones get cleaned up.

If you’re curious, want to follow the project, or just support it, here’s the repo:

👉 https://github.com/Passion-Over-Pain/The-Atlas-Six

If you like the idea, feel free to drop a star or reach out. Always open to feedback or collaboration.

Source: dev.to

arrow_back Back to Tutorials