Skip to content

suprafun/colyseus.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colyseus.js for the browser Join the chat at https://gitter.im/gamestdio/colyseus

JavaScript client for colyseus - a Minimalistic MMO Game Server for Node.js.

Usage

var client = new Colyseus('ws://localhost:2657');
var roomName = "room_name"
var room = client.join(roomName)

room.on('join', function() {
  console.log(client.id, "joined", roomName)
})

room.on('error', function() {
  console.log(client.id, "couldn't join", roomName)
})

room.on('leave', function() {
  console.log(client.id, "leaved", roomName)
})

room.on('data', function(data) {
  console.log(client.id, "received on", roomName, data)
})

room.on('patch', function(patches) {
  console.log(roomName, "will apply these changes:", patches)
})

room.on('update', function(newState, patches) {
  console.log(roomName, "new state:", newState, "changes applied:", patches)
})

License

MIT

About

JavaScript client for Colyseus MMO Game Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%