I currently have a Player class private instances, getters, and setters as well as a game class.
For the game, I ask the player for their name. It is saved in the object class. Every player has a $500 balance.
The game is called 21 of Dice and basically, it is like Blackjack in a sense that if you happen to beat the dealer (or computer) you win $100 and if you lose or tie, you lose $50.
When I play the game each time, it is creating a new player. I want it to be possible that I want to play as the same player with the updated balance. Any help would be greatly appreciated.
Instead of calling your play21method from your playAgainmethod, call your playAgainmethod from your play21Method, make it return a boolean and put your playmethod, except for the playercreation in a do whileloop that calls the playAgainmethod, when the player presses y it reurns true and otherwise false
It's good to be able to use someting, it's better to understand how it works.