瀏覽代碼

Add a getStat function

tags/v0.1.3
Fen Dweller 5 年之前
父節點
當前提交
5fd3c7392e
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      game.js

+ 4
- 0
game.js 查看文件

@@ -55,6 +55,10 @@ function initGamePostSetup(state) {
createStatDisplays(state.player.stats, "player");
}

function getStat(stat, state) {
return state.palyer.stats[stat].value;
}

function changeStat(stat, amount, state) {
let value = state.player.stats[stat].value;
value += amount;


Loading…
取消
儲存