From: Skullheadx Date: Sat, 16 May 2026 23:32:19 +0000 (-0400) Subject: passed or land on Go X-Git-Url: http://git.skullheadx.com/nixos/README?a=commitdiff_plain;h=e741703c9030ffd1f96a5d55f02d89991852c48a;p=monopoly-web.git passed or land on Go --- diff --git a/game/go.go b/game/go.go new file mode 100644 index 0000000..cc1ae84 --- /dev/null +++ b/game/go.go @@ -0,0 +1,7 @@ +package game + +func ProcessGo() { + for _, playerID := range GoVisitors { + Users[playerID].Money += 200 + } +} diff --git a/game/movement.go b/game/movement.go index d36ad06..92d6897 100644 --- a/game/movement.go +++ b/game/movement.go @@ -59,7 +59,11 @@ var ( ) func AdvancePlayer(playerID int32, currentPosition int32, diceRoll int32) { - nextPos := (currentPosition + diceRoll) % BoardSpaces + nextPos := (currentPosition + diceRoll) + if nextPos > BoardSpaces-1 { // Passed Go, but did not land on Go + GoVisitors = append(GoVisitors, playerID) + } + nextPos %= BoardSpaces propType := BoardSpaceTypes[nextPos]