A Go-based game server that hosts a collection of simple turn-based web games. It is designed with flexibility in mind, allowing for easy registration and addition of new games.
Players can select a game, create a room, and share the room's URL with a friend to play. Rooms are automatically closed under the following conditions:
- The game reaches an end state.
- The other player fails to join within the time limit.
- A player fails to make a move within the time limit (adjustable).
make build
The above command generates a single binary using stuffbin, bundling all HTML files and images.
make run
The application listens on port 8080
.
The application consists of 3 components
- Web: Handles REST and WebSocket handlers.
- Room: An in-memory data structure that manages game states, including making moves, tracking players, and determining game outcomes.
- Hub: Responsible for managing rooms (creation and destruction).