remix-multiplayer

Enable multiplayer support for a Remix game

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "remix-multiplayer" with this command: npx skills add farworld-labs/remix-skills/farworld-labs-remix-skills-remix-multiplayer

Implement Multiplayer Workflow

Overview

This skill guides you through enabling and integrating multiplayer functionality for games on the Remix platform.

Prerequisites

  • A game must be created on the Remix platform (you need a game ID).
  • The REMIX_API_KEY environment variable must be set.
  • The game must include the RemixSDK script tag:
    <script src="https://cdn.jsdelivr.net/npm/@remix-gg/sdk@latest/dist/index.min.js"></script>
    

Steps

1. Check for Existing Game ID

Read .remix-settings.json in the current directory. If it exists and contains a gameId, use that value.

Only if .remix-settings.json does not exist or has no gameId should you follow the upload-game workflow to create one.

2. Enable Multiplayer

Enable multiplayer for the game via REST:

POST https://api.remix.gg/v1/games/{gameId}
Authorization: Bearer $REMIX_API_KEY
Content-Type: application/json

{ "isMultiplayer": true }

3. Integrate Multiplayer in Game Code

const sdk = window.RemixSDK
await sdk.ready()

// Access all players in the session
const players = sdk.players // Array of player objects

// Listen for game state updates from other players
sdk.onGameStateUpdated((state) => {
  // Sync game state from other players
})

// Send game state to other players
sdk.multiplayer.actions.gameOver({ scores: playerScores })

Important: Use Multiplayer gameOver

For multiplayer games, use multiplayer.actions.gameOver -- NOT singlePlayer.actions.gameOver. Pass a scores object keyed by player ID:

sdk.multiplayer.actions.gameOver({
  scores: { [playerId]: score }
})

Keep Standard Hooks

Multiplayer games still need these callbacks:

sdk.onPlayAgain(() => {
  // Reset game state and restart
})

sdk.onToggleMute(({ isMuted }) => {
  // Mute or unmute all audio
})

Tips

  • Use sdk.players to get the list of players and their IDs.
  • onGameStateUpdated fires whenever another player sends state -- use it to keep all clients in sync.
  • Do NOT mix singlePlayer.actions.gameOver and multiplayer.actions.gameOver in the same game. Use one or the other.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

remix-api-key-auth

No summary provided by upstream source.

Repository SourceNeeds Review
General

remix-rest-snippets

No summary provided by upstream source.

Repository SourceNeeds Review
General

remix-add-sprite

No summary provided by upstream source.

Repository SourceNeeds Review
General

phaser-2d-arcade

No summary provided by upstream source.

Repository SourceNeeds Review