Added scroll()

This commit is contained in:
2026-06-10 01:42:33 -05:00
parent c2168b992d
commit f73c02437d
7 changed files with 375 additions and 43 deletions
+29 -1
View File
@@ -66,7 +66,7 @@ content = """
# # #
# | #
# #
# oo G - @ #
# oo G - M @ #
# #
# #
# #
@@ -102,6 +102,15 @@ bg = "#000000"
tile = 1
script_name = "mover"
[[objects]]
palette = "M"
tile = 15
fg = "#ffdd88"
bg = "#000000"
solid = true
name = "muffin"
script_name = "muffin"
[scripts]
greeter = """
fn init() {
@@ -134,4 +143,23 @@ fn bump(id) {
log(`mover bumped by ${id}`);
say("Ow!");
}
"""
muffin = """
fn bump(id) {
scroll([
"You find a small muffin on the ground, your favorite kind.",
"It smells of cinnamon and warm mornings.",
["eat", "Pick up the muffin and eat it."],
["ignore", "This is obviously a trap ignore it."]
]);
}
fn eat() {
log("You ate the muffin. Delicious.");
say("Mmm!");
}
fn ignore() {
log("You walk away from the muffin. Wise.");
say("Suspicious...");
}
"""