Skip to content

Commit 59743b0

Browse files
committed
Fix cost of autoclickers calculation
1 parent b984b5e commit 59743b0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/App.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function App() {
4141
}
4242
function addPointsFromClick() {
4343
//add points from clicking a button
44+
updateClickers(); //update clickers value
4445
setPoints(points + clickMultiplier); //increase points by 1 when button clicked
4546
setClicks(clicks + 1); //increase clicks made by 1
4647
}
@@ -49,15 +50,15 @@ function App() {
4950
if (checkPointsForUpgrade(points, 10 * Math.pow(2, clickers - 1))) {
5051
setPoints(points - 10 * Math.pow(2, clickers - 1)); //spend points
5152
setClickers(clickers + 1); //increase clickers by 1
52-
updateClickers();
53+
updateClickers(); //update clickers value
5354
}
5455
}
5556
function upgradePointsPerSecond() {
5657
//upgrade points per second
57-
if (checkPointsForUpgrade(points, 10 * Math.pow(2, pointsPerSecond))) {
58-
setPoints(points - 10 * Math.pow(2, pointsPerSecond));
58+
if (checkPointsForUpgrade(points, 10 * Math.pow(2, autoClickers))) {
59+
setPoints(points - 10 * Math.pow(2, autoClickers));
5960
setAutoClickers(autoClickers + 1); //increase autoclickers by 1
60-
updateAutoClickers();
61+
updateAutoClickers(); //update auto clickers value
6162
}
6263
}
6364
return (

0 commit comments

Comments
 (0)