(m7e m10s) A way to play Tiny Towns online, JavaScript edition
https://docs.google.com/spreadsheets/d/1GDSNe-IIiIBfKvkbsz_oXphl8n-mcJEDoOasDYmFC_o/edit
{
"players": [
{
"id": 1,
"name": "player 1",
"board": [null, "grey", "special", "blue", null, ... "yellow"],
"specialBuilding": "library"
},
{
"id": 2,
"name": "player 2",
"board": [null, "house", "red", "blue", null, ..., "yellow"],
"specialBuilding": "tower"
}
],
"gamePhase": "placing_tile",
"phaseInfo": "red",
"activePlayer": 2,
"finishedPlayers": [1],
"buildings": {
"well": "well",
"industrial": "factory",
}
}
Other players specialBuilding
is hidden unless they've already constructed it.
- <game started>
- Game state:
choosing_tile, 1
, - Player 1 sends
{
"phase": "choosing_tile",
"color": "red"
}
- Receive new game state:
placing_tile, 1, red
- Player 2 sends
{
"phase": "placing_tile",
"position": 7
}
- Don't re-broadcast updated state until everyone has placed?