[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 = """ fn init(me) { log(`hello from object — player at ${Player.x}, ${Player.y}`); set_tile(2); // change my glyph to ☻ — proves the write path //say("Hello there,\\ntraveller!"); log(`Player health: ${Player.health}`); } fn tick(me, dt) { if Player.x == me.x && Player.y == me.y && !me.waiting { say("Hey! Get offa me!"); me.queue.delay(5.0); } } """ [boards.start] name = "Starting Room" width = 21 height = 6 # No floor attribute → a blank (black) floor. grid = """ ##################### # # # G @ # # oo hh # # # ##################### """ [boards.start.palette] "#" = { type = "builtin", kind = "wall" } "o" = { type = "builtin", kind = "crate", glyph = { tile = 254, fg = "#aaaaaa", bg = "#000000" } } "@" = { type = "player" } # "G" = { type = "object", tile = 35, fg = "#aa3333", bg = "#000000", enter = "block", script_name = "greeter" } "h" = { type = "builtin", kind = "heart" } "G" = { type = "builtin", kind = "gem" }