diff --git a/feast.js b/feast.js index 718c7a0..b0fced3 100644 --- a/feast.js +++ b/feast.js @@ -96,7 +96,7 @@ function updateDisplay() { document.getElementById("time").innerHTML = "Time: " + renderTime(time); document.getElementById("stat-name").innerHTML = "Name: " + player.name; document.getElementById("stat-health").innerHTML = "Health: " + player.health + "/" + player.maxHealth; - document.getElementById("stat-fullness").innerHTML = "Fullness: " + player.fullness + "/" + player.maxFullness; + document.getElementById("stat-fullness").innerHTML = "Fullness: " + player.fullness(); } function advanceTime(amount) { diff --git a/vore.js b/vore.js index 32bf187..6c5d9b9 100644 --- a/vore.js +++ b/vore.js @@ -14,8 +14,9 @@ function Creature(name = "Creature") { function Player(name = "Player") { Creature.call(this, name); - this.fullness = 100; - this.maxFullness = 200; + this.fullness = function() { + return this.stomach.fullness(); + } } function Anthro() { @@ -81,6 +82,10 @@ function Container(name) { this.feed = function(prey) { this.contents.push(prey); }; + + this.fullness = function() { + return this.contents.reduce((total, prey) => total + prey.mass, 0); + } } function Stomach(bowels) { diff --git a/world.js b/world.js index 0f68a22..fff73dd 100644 --- a/world.js +++ b/world.js @@ -55,7 +55,7 @@ let locationsSrc = [ "desc": "A bare living room", "conn": [ { - "name": "Street", + "name": "North Street", "dir": NORTH, "desc": "You step outside." }, @@ -71,7 +71,7 @@ let locationsSrc = [ ] }, { - "name": "Street", + "name": "North Street", "desc": "It's a street", "conn": [ { @@ -81,7 +81,7 @@ let locationsSrc = [ }, { "name": "Living Room", - "dir": SOUTH, + "dir": EAST, "desc": "You step back into your apartment." } ],