new layer model

This commit is contained in:
2026-07-10 23:16:28 -05:00
parent 325d2c27dd
commit ad95a9cd8d
36 changed files with 1040 additions and 897 deletions
+10 -9
View File
@@ -6,15 +6,15 @@ start = "start"
# 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}`);
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: ${state.player.health}`);
log(`Player health: ${Player.health}`);
}
fn tick(me, state, dt) {
if state.player.x == me.x && state.player.y == me.y && !me.waiting {
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);
}
@@ -25,10 +25,11 @@ fn tick(me, state, dt) {
name = "Starting Room"
width = 21
height = 6
# No floor attribute → a blank (black) floor.
# 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]]
# 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]
content = """
#####################
# #
@@ -37,7 +38,7 @@ content = """
# #
#####################
"""
[boards.start.layers.palette]
[boards.start.grid.palette]
"#" = { kind = "wall", tile = "#", fg = "#808080", bg = "#606060" }
"o" = { kind = "crate", tile = 254, fg = "#aaaaaa", bg = "#000000" }
"@" = { kind = "player" }