45 lines
1.3 KiB
TOML
45 lines
1.3 KiB
TOML
[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, state) {
|
|
log(`hello from object — player at ${state.player.x}, ${state.player.y}`);
|
|
set_tile(2); // change my glyph to ☻ — proves the write path
|
|
//say("Hello there,\\ntraveller!");
|
|
log(`Player health: ${state.player.health}`);
|
|
}
|
|
|
|
fn tick(me, state, dt) {
|
|
if state.player.x == me.x && state.player.y == me.y && !me.waiting {
|
|
say("Hey! Get offa me!");
|
|
me.queue.delay(5.0);
|
|
}
|
|
}
|
|
"""
|
|
|
|
[boards.start.map]
|
|
name = "Starting Room"
|
|
width = 21
|
|
height = 6
|
|
|
|
# Layer 1: terrain, the player, objects and the portal. A space is always a
|
|
# transparent empty cell, so the floor below shows through.
|
|
[[boards.start.layers]]
|
|
content = """
|
|
#####################
|
|
# #
|
|
# G @ #
|
|
# oo #
|
|
# #
|
|
#####################
|
|
"""
|
|
[boards.start.layers.palette]
|
|
"#" = { 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" }
|