Kaynağa Gözat

Add simple example of room stats

tags/v0.1.2
Fen Dweller 6 yıl önce
ebeveyn
işleme
f26e585db9
1 değiştirilmiş dosya ile 17 ekleme ve 0 silme
  1. +17
    -0
      stories/demo.js

+ 17
- 0
stories/demo.js Dosyayı Görüntüle

@@ -36,9 +36,25 @@ stories.push({
},
"enter": (room, state) => {
print(["*sound of you entering your house*"]);

startTimer({
id: "room-counter",
func: state => {
state.world["Home"].data.stats.number.value += 1;
return true;
},
delay: 1000,
loop: true,
classes: [
],
room: "Home",
}, state);
},
"exit": (room, state) => {
print(["You are exiting your house"]);

stopRoomTimers("Home", state);
},
"actions": [
{
@@ -95,6 +111,7 @@ stories.push({
"hooks": [
(room, state) => {
print(["This is a test of the hooks"]);
return true;
}
],


Yükleniyor…
İptal
Kaydet