fixed a glitch

This commit is contained in:
biglyderv 2025-03-05 20:20:18 -05:00
parent be6730d109
commit 473c54efcd
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5

View file

@ -1,4 +1,6 @@
function addCube() { let exec = {};
exec.addCube = function () {
cubePos.push([Math.random() * 1000 - 500, Math.random() * 1000 - 500, Math.random() * 30 - 200, cubePos.push([Math.random() * 1000 - 500, Math.random() * 1000 - 500, Math.random() * 30 - 200,
Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1
]) ])
@ -11,7 +13,7 @@ if (!upgrades) {
{ {
'name': 'Set', 'name': 'Set',
'price': 10, 'price': 10,
'exec': addCube 'exec': 'addCube'
} }
] ]
} else { } else {
@ -31,7 +33,7 @@ for (let upgrade of upgrades) {
nothingness -= upgrade.price; nothingness -= upgrade.price;
upgrade.price *= 1.02; upgrade.price *= 1.02;
button.textContent = `Buy ${upgrade.name} for ${upgrade.price} nil` button.textContent = `Buy ${upgrade.name} for ${upgrade.price} nil`
upgrade.exec(); exec[upgrade.exec]();
}) })
} }