Skip to content

Instantly share code, notes, and snippets.

@timetocode
Created October 1, 2015 00:56
Show Gist options
  • Save timetocode/196d5e926d9c57d288c6 to your computer and use it in GitHub Desktop.
Save timetocode/196d5e926d9c57d288c6 to your computer and use it in GitHub Desktop.
// specify which properties should be networked, and their value types
Hero.prototype.netSchema = nengi.BinarySerializer.createSchema({
'id': nengi.UInt16,
'type': nengi.UInt8,
'x': nengi.Int16,
'y': nengi.Int16,
'hp': nengi.UInt8,
}, {
'x': { delta: true, binaryType: nengi.Int8 },
'y': { delta: true, binaryType: nengi.Int8 }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment