Преглед изворни кода

Added some to the tech demo

tags/v0.1.0^0
Fen Dweller пре 7 година
родитељ
комит
853b1bd5a0
1 измењених фајлова са 25 додато и 2 уклоњено
  1. +25
    -2
      stories/demo.js

+ 25
- 2
stories/demo.js Прегледај датотеку

@@ -7,7 +7,8 @@ stories.push({
"intro": { "intro": {
"start": "Home", "start": "Home",
"setup": state => { "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 => { "intro": state => {
print(["don't fall down the stairs ok"]); print(["don't fall down the stairs ok"]);
@@ -17,6 +18,11 @@ stories.push({
"sfx/oof.ogg" "sfx/oof.ogg"
], ],
"world": { "world": {
"Stairs": {
"id": "Stairs",
"name": "Stairs",
"desc": "You can't actually get here"
},
"Home": { "Home": {
"id": "Home", "id": "Home",
"name": "Home", "name": "Home",
@@ -70,6 +76,16 @@ stories.push({
return state.player.rooms[room.id].squinted; 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": [ "hooks": [
@@ -91,7 +107,14 @@ stories.push({
name: "Oof", name: "Oof",
desc: "Oof", desc: "Oof",
execute: (room, state) => { 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"); playSfx("sfx/oof.ogg");
} }
} }


Loading…
Откажи
Сачувај