Now let’s add the ability for the user to purchase new producers.
If you’ve created producers with single digit ids, you did everything right. If not, you can still fix it.
In this task you should only modify the
If user presses the key that corresponds to the id of a producer and they have enough gold to by it, then
- Deduct the cost of the producer from the gold balance
- Increase the cost of the next producer by multiplying the current cost by the growthRate
- Increment the count of the producer that was purchased
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.