Nyra Studios
Manual under construction. Some parts are incomplete or may change.

The other players

Nyra 0.5.4.28

As soon as you get in, you receive the otherPlayers list in the welcome. From that moment on you receive a message every time something changes.

Who is already there: otherPlayers

Every item of otherPlayers has playerId, username, x and y, plus the facing fields of the mode: facing in tile, facing and angle in 8 directions, nothing in platform.

Who joins: player-joined

When another player gets in, the others who are already inside receive (not you, you already have your welcome):

json
{ "type": "player-joined", "playerId": "…", "username": "luigi", "x": 320, "y": 320, "facing": 90 }

The facing fields follow the mode: facing in tile, facing and angle in 8 directions, nothing in platform.

Who moves: player-moved

player-moved goes to everyone, also to whoever moved. The shape depends on the mode; you find it in the Moving, by mode page. The message does not repeat the name: you already had it from the welcome or from player-joined.

Who turns: player-turned

Only in tile: when a player turns on the spot, everyone receives player-turned with playerId and facing.

Who leaves: player-disconnected

When a player goes away, all the others receive, in every mode:

json
{ "type": "player-disconnected", "playerId": "…" }

Your client takes that player off the screen.

The order of the messages

  • The newcomer receives welcome first. After that, the others receive player-joined.
  • The name (username) arrives only in the welcome and in player-joined.
  • If an account gets in while it is already connected, the others see player-disconnected of the old connection and right away player-joined of the new one, with the same playerId.