I'm trying to make the CPS Total: display the current total amount of Shacks multiplied by the value of the ShackOut value. Can somebody please help me achieve this? In this case, the base value of CPS Total should be 0 but should increase by 1 for each Shack purchased (by clicking the button). This number should update
<html>
<head>
<script>
var Cash = 75;
var CPStot = 0;
var ShackCost = 50;
var Shack = 0;
var ShackTot = 0;
var ShackTotCost1 = 50;
var ShackOut = 1;
function buyShack() {
if (Cash >= ShackCost) {
Cash = Cash - ShackCost;
Shack = Shack + 1;
ShackCost = Math.round(ShackCost * 1.05);
ShackCount = Shack;
ShackTotCost1 = ShackCost;
document.getElementById("Cash").innerHTML = Cash;
document.getElementById("ShackTot").innerHTML = ShackCount;
document.getElementById("ShackTotCost").innerHTML = ShackTotCost1;
}
}
setInterval(function() {
Cash = Cash + Shack * ShackOut;
document.getElementById("Cash").innerHTML = Cash;
}, 250);
</script>
</head>
<body>
<h1>
Shacks: <span id="ShackTot">0</span><br> Cash: <span id="Cash">75</span><br>
<button onclick="buyShack()" id="button">Click Me!</button><br> CPS Total: <span id="CPStotStart">0</span>
</h1>
</body>
</html>