i am new to coding and have started a little clicker game and right now im working on a reward system for when the players click amout reaches a certain value. i have figured out how to make one reward but im trying to figure out how to make multiple. I want the value of each click using the click_power var to go up by 2 each time. this is my code so far. '''
The button was clicked times
Click Me! let clicks = 0; let click_power = 1; let reward_received = false; function addClick() {
clicks = clicks + click_power;
if(clicks >= 10 && reward_received == false) {
click_power = click_power + 1;
reward_received = true;
}
document.querySelector('.total-clicks').textContent = clicks;
}
</script>
</body>
im trying to use the "reward_received" var using boolean telling if its true or false. every time i try to make a new reward i use reward_received1/2/3 ect.but when i run it, it will only do the reward with the highest required amount. please help and make it make since for a beginner. Thank you for your efforts.