Hey all, I’m a newbie both to this forum and pretty new to Java. Please don’t be too harsh!
For my first try, I want to make a little dice game called Pig. A player rolls the dice and accumulates points until she either holds or “craps out” by rolling a 1, playing against the computer.
I’ve got a lot of it on paper, not coding much yet because I keep getting hung up on how to take turns. I’ve got to know who the active player is obviously, so they can move, and each time the play shifts to another player, the dice score has to be reset, and the totals may change, etc.
I’ve thought of passing the active player to methods as a parameter, or creating an activePlayer object that alternately points to one player, or using some kind of boolean for my Player class like isActive, etc. Looking for code examples has been a lot harder than I thought it would be.
Is there any kind of system that’s been established as the best?