2-Player engine

Ludo 2-player (Blue vs Green)

A high-performance two-player board logic system. Built for competitive Blue vs Green matches with optimized movement paths and sub-millisecond turn validation.

Endpoint: Create match

Initialize a new 1v1 match. This endpoint deducts the match price from your balance and generates unique entry URLs for both players.

POST https://games.tzsmm.com/api/ludo-bg/create

Authentication

api_keyStringRequired

Match Configuration

match_titleStringOptional - Lobby name
callback_urlURLPost-game results webhook
win_urlURLRedirect after victory
lose_urlURLRedirect after defeat
home_urlURL"Back to Home" link

Player Details (Optional)

blue_nameDisplay name for P1
blue_logoAvatar URL for P1
green_nameDisplay name for P2
green_logoAvatar URL for P2

Creation response

{
  "status": true,
  "game_id": 102,
  "blue_id": 405, 
  "blue_key": "LBGblue102...",
  "blue_url": "https://ludo.tzsmm.com/ludo-bg/join/102/LBGblue...",
  "green_id": 406, 
  "green_key": "LBGgreen102...",
  "green_url": "https://ludo.tzsmm.com/ludo-bg/join/102/LBGgreen..."
}
Error: {"status": false, "message": "Insufficient Balance"}
Error: {"status": false, "message": "Invalid API key"}

Endpoint: Verify status

Fetch the authoritative state and winner details for any 2-player independent match. Use this for polling or manual reconciliation.

POST https://games.tzsmm.com/api/ludo-bg/status
api_keyRequired
game_idRequired

Status response

{
  "status": true,
  "game_id": 102,
  "game_status": "finished",
  "winner_id": 405, 
  "players": [
     { 
       "color": "blue", 
       "name": "P1", 
       "logo": "...", 
       "lives": 3, 
       "player_status": "winner" 
     },
     { 
       "color": "green", 
       "name": "P2", 
       "logo": null, 
       "lives": 0, 
       "player_status": "eliminated" 
     }
  ]
}

Server-to-Server Webhook

If callback_url is provided during creation, our engine will POST the final match results immediately upon completion.

Callback Payload
{
  "game_id": 102,
  "status": "finished",
  "winner_id": 405,
  "results": [
    { "player_id": 405, "color": "blue", "name": "UserA", "status": "winner", "rank": 1 },
    { "player_id": 406, "color": "green", "name": "UserB", "status": "eliminated", "rank": null }
  ]
}