Browse Source

Rearranged layout. Added stroll/stand info. Fixed plural kills. Fixed verbose setting for containers

tags/v0.7.0
Fen Dweller 7 years ago
parent
commit
b5c6c5ca12
4 changed files with 25 additions and 14 deletions
  1. +8
    -3
      game.js
  2. +3
    -3
      recursive-macro.js
  3. +7
    -7
      stroll.html
  4. +7
    -1
      style.css

+ 8
- 3
game.js View File

@@ -12,6 +12,11 @@ victims = {};
function toggle_auto() function toggle_auto()
{ {
strolling = !strolling; strolling = !strolling;
document.getElementById("strolling-indicator").innerHTML = strolling ? "Strolling" : "Standing";
if (strolling)
update(["You start walking."]);
else
update(["You stop walking."]);
} }
function initVictims() function initVictims()
{ {
@@ -32,7 +37,7 @@ function initVictims()
// lists out total people // lists out total people
function summarize(sum, fatal = true) function summarize(sum, fatal = true)
{ {
return "(" + sum["Person"] + " " + (fatal ? "kills" : "people") + ")";
return "(" + sum["Person"] + " " + (fatal ? (sum["Person"] > 1 ? "kills" : "kill") : (sum["Person"] > 1 ? "people" : "person")) + ")";
} }


var stomach = [] var stomach = []
@@ -245,9 +250,9 @@ function doDigest(containerName)
} }


if (containerName == "stomach") if (containerName == "stomach")
update(["Your stomach gurgles as it digests " + container.describe() + " " + summarize(container.sum())]);
update(["Your stomach gurgles as it digests " + container.describe(false) + " " + summarize(container.sum())]);
else if (containerName == "bowels") else if (containerName == "bowels")
update(["Your bowels churn as they absorb " + container.describe() + " " + summarize(container.sum())]);
update(["Your bowels churn as they absorb " + container.describe(false) + " " + summarize(container.sum())]);


if (digestType.length > 0) { if (digestType.length > 0) {
setTimeout(function() { setTimeout(function() {


+ 3
- 3
recursive-macro.js View File

@@ -144,11 +144,11 @@ var masses =


// describes everything in the container // describes everything in the container


function describe_all(contents) {
function describe_all(contents,verbose=true) {
var things = []; var things = [];
for (var key in contents) { for (var key in contents) {
if (contents.hasOwnProperty(key)) { if (contents.hasOwnProperty(key)) {
things.push(contents[key].describe());
things.push(contents[key].describe(verbose));
} }
} }
return merge_things(things); return merge_things(things);
@@ -360,7 +360,7 @@ function Container(contents = []) {
} }


this.describe = function(verbose = true) { this.describe = function(verbose = true) {
return describe_all(this.contents)
return describe_all(this.contents,false)
} }


return this; return this;


+ 7
- 7
stroll.html View File

@@ -8,9 +8,14 @@
<script src="game.js"></script> <script src="game.js"></script>
</head> </head>
<body> <body>
<div class=stat-header-self id=stats-self>
<p>Stats</p>
<div class=stat-line id=height></div>
<div class=stat-line id=mass></div>
</div>
<div id=game-area> <div id=game-area>
<div id=log> <div id=log>
<div>Welcome to Stroll 0.1.1</div>
<div>Welcome to Stroll 0.1.2</div>
<div>It's a nice day for a walk</div> <div>It's a nice day for a walk</div>
</div> </div>
<button id=button-grow>Get Bigger</button> <button id=button-grow>Get Bigger</button>
@@ -19,13 +24,8 @@
<button id=button-anal_vore>Sit</button> <button id=button-anal_vore>Sit</button>
<div></div> <div></div>
<button id=button-stroll>Stroll</button> <button id=button-stroll>Stroll</button>
<div id=strolling-indicator>Standing</div>
<div class=flex-container> <div class=flex-container>
<div class=stat-header id=stats-self>
<p>Stats</p>
<div class=stat-line id=height></div>
<div class=stat-line id=mass></div>
</div>
<div class=stat-header id=stats-stomped> <div class=stat-header id=stats-stomped>
<p>Stomped</p> <p>Stomped</p>
</div> </div>


+ 7
- 1
style.css View File

@@ -13,6 +13,12 @@ body {
float:left; float:left;
} }


.stat-header-self {
font-weight: bold;
font-size: 150%;
min-width:250px;
float:left;
}
.stat-header { .stat-header {
font-weight: bold; font-weight: bold;
font-size: 150%; font-size: 150%;
@@ -30,5 +36,5 @@ body {
} }


.action-button { .action-button {
} }

Loading…
Cancel
Save