puttCourse.package
README.md
round
puttCourse.round runs a multi-hole stroke-play round of mini golf for any number of players. Game code creates a round from an ordered list of holes (Round.new{ holes = {...}, players = "peers" }). Everyone plays at the same time, each player on their own current hole. The round counts strokes from the course balls (or from your own shot / penalty / holed calls), adds water and out-of-bounds penalties, caps a hole at par + maxOverPar (the ball goes into the cup and the hole is finished), gives stars per hole, places each player's ball on their next tee, can wait for everyone before moving on (waitForAll), lets players join and leave mid-round, restarts, and ends with a ranking (lowest total, then most stars).
Events: holeStarted, shot, penalty, holeFinished {player, hole, strokes, par, toPar, stars, holeInOne, capped}, roundFinished {ranking}, playerJoined, playerLeft, roundStarted, roundRestarted.
Multiplayer: in play the state sits on a synced PuttRound_<id> entity with a RoundState component. Its owner is the one authority that applies the rules; the engine hands it to a peer that stays when the owner leaves. See the package README for the full API.