Real money Snakes and ladders
Create a snakes and ladders game where people can come, sign in/sign up with google, play a game with someone else.
Points to keep in mind
- User should wait in
lobby
until another person comes to the platform to play against them. - When the other person joins, both people should take turns in rolling the dice.
- The dice roll should happen on the backend and sent over to the frontend.
- The game logic should run both on the websocket server and the clients.
- The server should return a
GAME_OVER
event whenever either of the party wins - Add OAuth using Login with Google
HTTP Service
- Signup
- Signin
- On ramp money.
- Off ramp money.
- Get history of games played and money won/lost.
- Get Current Balance (in Rs)
Websocket service
Browser to Server:
1. Join a New Game
{ type: "JOIN_GAME", payload: { roomId: "123" }}
2. Roll the Dice
{ type: "ROLL_DICE", payload: { userId: "user_1" }}
3. Abandon the Game
{ type: "ABANDON_GAME", payload: { userId: "user_1", roomId: "123" }}
Server to Browser:
1. Dice Results
{ type: "DICE_RESULTS", payload: { userId: "user_1", diceResults: [5] }}
2. Board State
{ type: "BOARD_STATE", payload: { roomId: "123", players: [ { userId: "user_1", position: 3 }, { userId: "user_2", position: 5 } ], turn: "user_1" }}
3. Game Finished
{ type: "GAME_FINISHED", payload: { roomId: "123", winnerId: "user_2" }}