| @@ -36,7 +36,7 @@ function createStatDisplays(stats, statType) { | |||||
| const bar = document.createElement("div"); | const bar = document.createElement("div"); | ||||
| bar.classList.add("stat-bar"); | bar.classList.add("stat-bar"); | ||||
| bar.style["background-color"] = val.color(val); | |||||
| bar.style["background-color"] = val.color; | |||||
| field.appendChild(label); | field.appendChild(label); | ||||
| field.appendChild(bar); | field.appendChild(bar); | ||||
| @@ -96,7 +96,7 @@ function updateStatDisplay(stats, statType) { | |||||
| if (val.type == "meter") { | if (val.type == "meter") { | ||||
| const bar = document.querySelector("#" + statType + "-info-" + key + " > .stat-bar"); | const bar = document.querySelector("#" + statType + "-info-" + key + " > .stat-bar"); | ||||
| bar.style["background-color"] = val.color(val); | |||||
| bar.style["background-color"] = val.color; | |||||
| } | } | ||||
| } | } | ||||
| @@ -9,8 +9,8 @@ stories.push({ | |||||
| "start": "Home", | "start": "Home", | ||||
| "setup": () => { | "setup": () => { | ||||
| state.info.time.value = 3600; | state.info.time.value = 3600; | ||||
| state.player.stats.oofs = {name: "Oofs", type: "meter", value: 0, max: 10, color: (self) => { console.log('hi'); return "rgb(" + (155 + self.value*10) + ",0,0)"}}; | |||||
| state.player.stats.number = {name: "Number", type: "counter", value: 0, max: 10, color: () => "rgb(255,255,255)"}; | |||||
| state.player.stats.oofs = {name: "Oofs", type: "meter", value: 0, max: 10, get color() { return "rgb(" + (155 + this.value*10) + ",0,0)"}}; | |||||
| state.player.stats.number = {name: "Number", type: "counter", value: 0, max: 10, color: "rgb(255,255,255)"}; | |||||
| }, | }, | ||||
| "intro": () => { | "intro": () => { | ||||
| print(["don't fall down the stairs ok"]); | print(["don't fall down the stairs ok"]); | ||||
| @@ -33,8 +33,8 @@ stories.push({ | |||||
| start: "stomach", | start: "stomach", | ||||
| setup: () => { | setup: () => { | ||||
| state.info.time.value = 86400 - 60 * 25 - 25; | state.info.time.value = 86400 - 60 * 25 - 25; | ||||
| state.player.stats.health = {name: "Health", type: "meter", value: 100, min: 0, max: 100, color: (self) => "rgb(" + (155+self.value) + ",0,0)"}; | |||||
| state.player.stats.stamina = {name: "Stamina", type: "meter", value: 100, min: 0, max: 100, color: (self) => "rgb(100," + (155+self.value) + ",0)"}; | |||||
| state.player.stats.health = {name: "Health", type: "meter", value: 100, min: 0, max: 100, get color() {return "rgb(" + (155+this.value) + ",0,0)"}}; | |||||
| state.player.stats.stamina = {name: "Stamina", type: "meter", value: 100, min: 0, max: 100, get color() {return "rgb(100," + (155+this.value) + ",0)"}}; | |||||
| startTimer({ | startTimer({ | ||||
| id: "taunting", | id: "taunting", | ||||