[READ-ONLY] Mirror of https://github.com/excaliburjs/sample-multiplayer-massive-realm. excaliburjs.com/sample-multiplayer-massive-realm/
excalibur excaliburjs sample
0

Configure Feed

Select the types of activity you want to include in your feed.

readme.md

Massive Realm Configuration#

  • Create an account
  • Create a project

Massive Realm Code#

Client section defines event signatures callable by the client

alt text

Server section defines server processing

alt text

alt text

if (!$connection.vars.model) {
    $connection.vars.model = $room.model('player'); // casing is important here
    $connection.vars.model.id = $connection.id;
}

$connection.vars.model.x = $params.x;
$connection.vars.model.y = $params.y;

$connection.broadcast('MovePlayer', {
    player: $connection.vars.model.get()
});

alt text

let players = [];
for (let i in $room.connections) {
    if ($room.connections[i].id == $connection.id) continue;
    players.push($room.connections[i].vars.model.get());
}
$connection.call('AllPlayers', { players });

Hooks

alt text

Models

alt text

Rooms

alt text