The prep is done, so let’s start from the beginning.
Once the user has enough gold to purchase the first producer, it makes sense to change the welcome message.
I suggest creating a function
checkInitCompleted that should be called from
handleKeyPress once the user has enough gold to purchase the first producer.
checkInitCompleted should work:
- It should accept forwarded arguments
- It should move to the beginning of the first line, erase it and print the message
You can purchase producers by clicking the number button (1, 2, 3, ...)
- It should print the messages
PRODUCTION RATE:on lines 2 and 3 respectively.
- It should be called from
handleKeyPressif the user has enough gold to purchase first producer.
Don’t forget that the transition from the initial welcome message should happen only once.
Even though the function
handleKeyPress could be called multiple time,
checkInitCompleted should only be called once.
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.