Game Development 7 min read

Building a Kid-Friendly Game Engine: How a Programmer Taught His 8‑Year‑Old to Code

Nick built a simple, HyperCard‑inspired game engine called Canon, composed of players, rooms, and items, and a deliberately rudimentary scripting language Cant, to let his eight‑year‑old daughter experiment with creating and modifying game worlds, illustrating educational design trade‑offs between simplicity and functionality.

21CTO
21CTO
21CTO
Building a Kid-Friendly Game Engine: How a Programmer Taught His 8‑Year‑Old to Code

Nick, a programmer, wanted to satisfy his eight‑year‑old daughter's wish to create her own video games, so he built a tiny game engine he calls “Canon”. The system lets the child assemble characters, rules, and methods inside a multi‑role world using text, images, and a small custom script language.

Canon is structured around three core components: players , rooms , and items . Players and rooms are defined by textual descriptions with optional pictures, while items encapsulate all remaining capabilities such as pets, NPCs, spells, vehicles, doors, and quest markers.

The behavior of items is expressed in a dedicated language named Cant . An example item definition looks like this:

item "Hooded Lantern" {
  describe "An iron lantern with a hinged hood."
  on "light" {
    narrate "{player}'s {item} swings open and warm light spills out."
  }
}

This snippet defines a lantern that can be lit, producing a narrative line when the player triggers the "light" action.

Canon also provides a special keyword or that randomly selects one of several alternatives each time it is evaluated. For example, a dice roll is written as: say1! or 2! or 3! or 4! ... In contrast, a modern language would use a function call such as randInt(1,20). Nick explains that the Cant syntax is deliberately inefficient but extremely easy to understand, prioritising educational clarity over writing speed and deliberately violating the DRY principle.

State in Canon is attached to items, not to players. Items can have two kinds of state: marks (uppercase identifiers) and numbers (lowercase identifiers). For instance, a campfire item might have warmth 10, while an NPC could have health 20. Because state lives on items, player‑versus‑player combat becomes a matter of consent – if you do not want to duel, you simply avoid picking up the duel wand.

The overall design goal is to recreate the pure, instant‑feedback experience Nick felt at age nine when using HyperCard. Canon offers immediate visual feedback, a "view source" capability where everything is built with the engine’s own tools, a smooth gradient from graphical UI to code, and a limited set of primitives that are powerful enough for creative expression yet simple enough for a beginner to master.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

game developmentHyperCardeducational toolscustom scripting languagegame engine design
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.