seed display

seeds are displayed in pause menu and intro map
seeds from your previous run is displayed in settings after you die
fixed some minor seed inconsistency
This commit is contained in:
landgreen
2022-02-06 21:07:52 -08:00
parent 775f45b863
commit d51a9d6dd8
8 changed files with 45 additions and 27 deletions

View File

@@ -521,6 +521,14 @@ const simulation = {
},
firstRun: true,
splashReturn() {
document.getElementById("previous-seed").innerHTML = `previous seed: <span style="font-size:80%;">${Math.initialSeed}</span><br>`
document.getElementById("seed").value = Math.initialSeed = Math.seed //randomize initial seed
//String(document.getElementById("seed").value)
// Math.seed = Math.abs(Math.hash(Math.initialSeed)) //update randomizer seed in case the player changed it
simulation.clearTimeouts();
simulation.onTitlePage = true;
document.getElementById("splash").onclick = function() {
@@ -695,6 +703,7 @@ const simulation = {
// simulation.makeTextLog(`input.key.left<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.left}</span>", "<span class='color-text'>ArrowLeft</span>"]`);
// simulation.makeTextLog(`input.key.down<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.down}</span>", "<span class='color-text'>ArrowDown</span>"]`);
// simulation.makeTextLog(`input.key.right<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.right}</span>", "<span class='color-text'>ArrowRight</span>"]`);
simulation.makeTextLog(`Math.seed <span class='color-symbol'>=</span> ${Math.initialSeed}`);
simulation.makeTextLog(`<span class='color-var'>const</span> engine <span class='color-symbol'>=</span> Engine.create(); <em>//simulation begin</em>`);
simulation.makeTextLog(`engine.timing.timeScale <span class='color-symbol'>=</span> 1`);
// simulation.makeTextLog(`input.key.field<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.field}</span>", "<span class='color-text'>MouseRight</span>"]`);