Files

46 lines
1.3 KiB
TOML
Raw Permalink Normal View History

2026-06-28 00:12:52 -05:00
[world]
name = "Tiny"
start = "start"
# Named Rhai scripts shared across all boards in this world.
# Objects reference a script by name via `script_name`.
[scripts]
greeter = """
2026-07-10 23:16:28 -05:00
fn init(me) {
log(`hello from object — player at ${Player.x}, ${Player.y}`);
2026-06-28 00:12:52 -05:00
set_tile(2); // change my glyph to ☻ — proves the write path
//say("Hello there,\\ntraveller!");
2026-07-10 23:16:28 -05:00
log(`Player health: ${Player.health}`);
2026-06-28 00:12:52 -05:00
}
2026-07-10 23:16:28 -05:00
fn tick(me, dt) {
if Player.x == me.x && Player.y == me.y && !me.waiting {
2026-06-28 00:12:52 -05:00
say("Hey! Get offa me!");
me.queue.delay(5.0);
}
}
"""
[boards.start.map]
name = "Starting Room"
width = 21
height = 6
2026-07-10 23:16:28 -05:00
# No floor attribute → a blank (black) floor.
2026-06-28 00:12:52 -05:00
2026-07-10 23:16:28 -05:00
# The single grid: all solids and most non-solids. A space is always a transparent
# empty cell, so the floor shows through.
[boards.start.grid]
2026-06-28 00:12:52 -05:00
content = """
#####################
# #
# G @ #
# oo #
# #
#####################
"""
2026-07-10 23:16:28 -05:00
[boards.start.grid.palette]
2026-06-28 00:12:52 -05:00
"#" = { kind = "wall", tile = "#", fg = "#808080", bg = "#606060" }
"o" = { kind = "crate", tile = 254, fg = "#aaaaaa", bg = "#000000" }
"@" = { kind = "player" }
"G" = { kind = "object", tile = "#", fg = "#aa3333", bg = "#000000", solid = false, script_name = "greeter" }