]> Skullheadx's Git Forge - monopoly-web.git/commitdiff
passed or land on Go
authorSkullheadx <admonty1@protonmail.com>
Sat, 16 May 2026 23:32:19 +0000 (19:32 -0400)
committerSkullheadx <admonty1@protonmail.com>
Sat, 16 May 2026 23:32:19 +0000 (19:32 -0400)
game/go.go [new file with mode: 0644]
game/movement.go

diff --git a/game/go.go b/game/go.go
new file mode 100644 (file)
index 0000000..cc1ae84
--- /dev/null
@@ -0,0 +1,7 @@
+package game
+
+func ProcessGo() {
+       for _, playerID := range GoVisitors {
+               Users[playerID].Money += 200
+       }
+}
index d36ad06074d8414afb3f9aeae97c151664d09505..92d689733d456959309c87c5571ab878fa45fba2 100644 (file)
@@ -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]