Chainreaction
Backend API for game chain reaction with online multiplayer mode
Install / Use
/learn @darkLord19/ChainreactionREADME
ChainReaction
This repository contains backend API code for the game Chain Reaction with online multiplayer mode.
endpoints:(both are GET endpoints)
- /new
query parmas: players_count, dimension on success:
{game_roomname: "gamblerripple"}
- /games/:rommname/join
query params: username, color on success:
{
Success: "You have joined the game mothafucka"
game_instance: {
all_players: [{…}]
current_turn: 0
dimension: 4
players_count: 2
room_name: "gamblerripple"
}
user: {
color: "#FF1744"
username: "test"
}
- /games/:roomname/colors on success returns:
{
colors: [...]
}
- /games/:roomname/play
query params: username on success: doesn't return, establishes websocket connection
How to Build
First you will need golang package installed for your respective OS. Refer golang homepage on HowTo.
git clone https://github.com/darkLord19/chainreaction
cd ChainReaction
go build
This will generate binary named chainreaction in the directory which you can run as normal unix/windows executable.
Code overview
- api/ contains logic for endpoints
- simulate/ contains logic for chain reaction game, how to simulate gameboard etc
- datastore/ contains simple in memory mapping of current active games and all games
- game/ contains models required for game instance and other helpers
- models/ contains types used for game abstraction
- helpers/ contains helper functions for models
- utils/ contains utility function
Future ideas
- Build a decent front end to play the game
- Plan a proper websocket messanging mechanism
- Refractor code to better fit golang model
- Add tests
Contribution guidelines
- Anyone who is interested in contributing is welcome. There is no hard requirements. If you are making code better or implementing some new feature, you are most welcome to do so.
Related Skills
gh-issues
349.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
349.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
349.2kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
