Ver código fonte

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

tags/v0.7.0
Fen Dweller 7 anos atrás
pai
commit
b5c6c5ca12
4 arquivos alterados com 25 adições e 14 exclusões
  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 Ver arquivo

@@ -12,6 +12,11 @@ victims = {};
function toggle_auto()
{
strolling = !strolling;
document.getElementById("strolling-indicator").innerHTML = strolling ? "Strolling" : "Standing";
if (strolling)
update(["You start walking."]);
else
update(["You stop walking."]);
}
function initVictims()
{
@@ -32,7 +37,7 @@ function initVictims()
// lists out total people
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 = []
@@ -245,9 +250,9 @@ function doDigest(containerName)
}

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")
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) {
setTimeout(function() {


+ 3
- 3
recursive-macro.js Ver arquivo

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

// describes everything in the container

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

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

return this;


+ 7
- 7
stroll.html Ver arquivo

@@ -8,9 +8,14 @@
<script src="game.js"></script>
</head>
<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=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>
<button id=button-grow>Get Bigger</button>
@@ -19,13 +24,8 @@
<button id=button-anal_vore>Sit</button>
<div></div>
<button id=button-stroll>Stroll</button>
<div id=strolling-indicator>Standing</div>
<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>
<p>Stomped</p>
</div>


+ 7
- 1
style.css Ver arquivo

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

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

.action-button {
}

Carregando…
Cancelar
Salvar