fixed a glitch
This commit is contained in:
parent
be6730d109
commit
473c54efcd
1 changed files with 5 additions and 3 deletions
|
@ -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]();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue