Starting your own game
A root is free inside its own game and sets the terms for everyone who builds
on it. No open or seal applies to the root itself, though the
limits do.
Build any kind of game. The demo roots include a 3D open world, a 2D side-scroller, a 2D role-playing game at 320 by 180, a real-time strategy game and a town sim. The runtime does not assume a camera, a player or a dimension.
Decide what children may change. Your open list names the points, and a
* matches any run of characters. The demo roots show three styles.
| Style | open | What a child can do | Demo roots |
|---|---|---|---|
| Wide open | rules.*, zones, items, slots.* | Tune it, add to it, or replace the world and the player | Starter World, Paper Run |
| Rules and items | rules.*, items | Tune it and add new things to place, but not new places | Boxborough |
| Rules only | rules.* | Change the data the game is made from, such as its map and palette | Cinder Road, Hivelines |
Hold things back. Anything you do not open is closed. Anything you list
under seal stays yours even inside a pattern you opened. Starter World opens
rules.* and seals rules.world.gravity.
Design your hooks. Children reach your game only through rules, zones, items, slots and events. If you want them to restyle the sky, read a rule for it. If you want them to alter movement, send an event before you move the player. Your HUD, your input handling and your camera are closed to children unless you put a rule, a slot or an event in front of them.
Build when everyone has had their say. Register your rules, zones, items
and slots in _ready, then build the world when you hear start. By then
every layer above you has run.
func _ready() -> void:
Variations.set_rule("player.speed", 7.0)
Variations.register_zone("meadow", _meadow)
Variations.event.connect(_on_event)
func _on_event(event_name: String, _payload: Dictionary) -> void:
if event_name == "start":
for zone_name in Variations.zones():
add_child(Variations.zones()[zone_name].build.call())
Use the shared look. Jewel gives every game the same palette, sky and
lighting, so a new root fits beside the others. See the
Jewel reference.