瀏覽代碼

Added some to the tech demo

tags/v0.1.0^0
Fen Dweller 6 年之前
父節點
當前提交
853b1bd5a0
共有 1 個文件被更改,包括 25 次插入2 次删除
  1. +25
    -2
      stories/demo.js

+ 25
- 2
stories/demo.js 查看文件

@@ -7,7 +7,8 @@ stories.push({
"intro": {
"start": "Home",
"setup": state => {

state.info.time = 0;
state.player.stats.oofs = {name: "Oofs", type: "meter", value: 0, max: 10, color: "rgb(255,0,0)"};
},
"intro": state => {
print(["don't fall down the stairs ok"]);
@@ -17,6 +18,11 @@ stories.push({
"sfx/oof.ogg"
],
"world": {
"Stairs": {
"id": "Stairs",
"name": "Stairs",
"desc": "You can't actually get here"
},
"Home": {
"id": "Home",
"name": "Home",
@@ -70,6 +76,16 @@ stories.push({
return state.player.rooms[room.id].squinted;
}
]
},
"descend": {
"target": "Stairs",
"desc": "Dare you go down the stiars?",
"hooks": [
(room, state) => {
print(["You're very concerned that you'll fall down all these stairs."]);
return false;
}
]
}
},
"hooks": [
@@ -91,7 +107,14 @@ stories.push({
name: "Oof",
desc: "Oof",
execute: (room, state) => {
print(["Oof"]);
state.player.stats.oofs.value += 1;

if (state.player.stats.oofs.value >= state.player.stats.oofs.max) {
state.player.stats.oofs.value = state.player.stats.oofs.max;
print(["Big oof"]);
} else {
print(["Oof"]);
}
playSfx("sfx/oof.ogg");
}
}


Loading…
取消
儲存