Bläddra i källkod

Got fullness working

tags/v0.2.8
Fen Dweller 7 år sedan
förälder
incheckning
6119f3fe9a
3 ändrade filer med 11 tillägg och 6 borttagningar
  1. +1
    -1
      feast.js
  2. +7
    -2
      vore.js
  3. +3
    -3
      world.js

+ 1
- 1
feast.js Visa fil

@@ -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) {


+ 7
- 2
vore.js Visa fil

@@ -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) {


+ 3
- 3
world.js Visa fil

@@ -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."
}
],


Laddar…
Avbryt
Spara