Skip to content

Instantly share code, notes, and snippets.

@nsbingham
Created June 5, 2012 19:25
Show Gist options
  • Save nsbingham/2877169 to your computer and use it in GitHub Desktop.
Save nsbingham/2877169 to your computer and use it in GitHub Desktop.
Multiplayer plugin simple enemy position update
// Sync enemy positions; uses Underscore.js
_.each(data.enemies, function(e){
var enemy = this.getEntityByRemoteName(e.remoteName);
// Reset the entities position
if(enemy) {
enemy.pos = e.pos;
}
}.bind(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment