Skip to content

Commit

Permalink
Update 0.2
Browse files Browse the repository at this point in the history
new generator.
bugfixes
  • Loading branch information
NotAKrayer authored Jan 29, 2024
1 parent 461fc88 commit a4f6742
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 3 deletions.
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="stylesheet" href="style.css"></link>

<body class="body">
<p><font size="6" color="white">Absurd Incremental v0.1</font></p>
<p><font size="6" color="white">Absurd Incremental v0.2</font></p>
</body>

<hr width="2000" size="4" class="line" align="leftTop"/>
Expand All @@ -24,4 +24,11 @@
</button>
</div>

<div>
<button class="nothingGen2" id="gen2bg" onclick="gen2Buy()">
<p><font color="white" size="3">Nothing Generator 2 | <span id="gen2">0 </span> / 10 | <span id="gen2cost">100 </span> | <span id="gen2val">0</span> Generators | <span id="gen2x">1</span>x</font></p>
</button>
</div>


</html>
65 changes: 64 additions & 1 deletion scripts/NothingGen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ var gen1 = new Decimal("0.0");
var gen1val = new Decimal("0.0");
var gen1x = new Decimal("1.0");

var gen2cost = new Decimal("100.0");
var gen2 = new Decimal("0.0");
var gen2val = new Decimal("0.0");
var gen2x = new Decimal("1.0");
var gen1get = new Decimal("1.0");

function BGButtonTest() {
if (Nothing.gte(gen1cost)) {
const gen1bg = document.getElementById("gen1bg");
Expand All @@ -15,27 +21,55 @@ function BGButtonTest() {
}
}

function BGButtonTest2() {
if (Nothing.gte(gen2cost)) {
const gen2bg = document.getElementById("gen2bg");
gen2bg.style.background = "#43c443";
gen2bg.style.cursor = "pointer";
} else if (Nothing.lt(gen2cost)) {
const gen2bg = document.getElementById("gen2bg");
gen2bg.style.background = "transparent";
gen2bg.style.cursor = "default";
}
}

function NothingGet() {
Nothing = Decimal.add(Nothing, nget);
document.getElementById("Nothing").innerHTML = Nothing.toPrecision(3);
}

setInterval("BGButtonTest()", 100);
setInterval("BGButtonTest2()", 100);
setInterval("NothingGet()", 1000);

function gen1Buy() {
if (Nothing.gte(gen1cost)) {
nget = Decimal.add(nget, "1");
gen1 = Decimal.add(gen1, "1");
gen1val = Decimal.add(gen1val, "1");
Nothing = Decimal.minus(Nothing, gen1cost);
document.getElementById("Nothing").innerHTML = Nothing.toPrecision(3);
document.getElementById("gen1").innerHTML = gen1.toPrecision(3);
document.getElementById("gen1cost").innerHTML = gen1cost.toPrecision(3);
document.getElementById("gen1val").innerHTML = gen1val.toPrecision(3);
const gen2bg = document.getElementById("gen2bg");
gen2bg.style.display = "block";
}
}

function gen2Buy() {
if (Nothing.gte(gen2cost)) {
nget = Decimal.add(nget, "1");
gen2 = Decimal.add(gen2, "1");
gen2val = Decimal.add(gen2val, "1");
Nothing = Decimal.minus(Nothing, gen2cost);
document.getElementById("Nothing").innerHTML = Nothing.toPrecision(3);
document.getElementById("gen2").innerHTML = gen2.toPrecision(3);
document.getElementById("gen2cost").innerHTML = gen2cost.toPrecision(3);
document.getElementById("gen2val").innerHTML = gen2val.toPrecision(3);
}
}


function newGen1() {
if (new Decimal(gen1).gte(10.0)) {
gen1x = Decimal.mul(gen1x, "2");
Expand All @@ -52,4 +86,33 @@ function newGen1() {
}
}

function newGen2() {
if (new Decimal(gen2).gte(10.0)) {
gen2x = Decimal.mul(gen2x, "2");
gen2cost = Decimal.mul(gen2cost, "100");
gen2 = "0.0";
nget = Decimal.mul(nget, gen2x);
document.getElementById("gen2cost").innerHTML = gen2cost.toPrecision(3);
document.getElementById("gen2x").innerHTML = gen2x.toPrecision(3);
document.getElementById("gen2").innerHTML = new Decimal(gen2).toPrecision(3);
document.getElementById("gen2val").innerHTML = gen2val.toPrecision(3);
const gen2bg = document.getElementById("gen2bg");
gen2bg.style.background = "transparent";
gen2bg.style.cursor = "default";
}
}

function gennget() {
nget = Decimal.mul(gen1val, gen1x);
gen1get = Decimal.mul(gen2val, gen2x);
}

function gen2nget() {
gen1val = Decimal.add(gen1val, gen1get);
document.getElementById("gen1val").innerHTML = gen1val.toPrecision(3);
}

setInterval("gennget()", 100);
setInterval("gen2nget()", 1000);
setInterval("newGen1()", 100);
setInterval("newGen2()", 100);
15 changes: 14 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,17 @@
outline: transparent;
border-radius: 10px;
cursor: default;
}
}

.nothingGen2 {
display: none;
width: 550px;
border: 2px solid white;
height: 50px;
background-color: transparent;
outline: transparent;
border-radius: 10px;
cursor: default;
position: relative;
top: 10px;
}

0 comments on commit a4f6742

Please sign in to comment.