Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created November 15, 2012 04:46
Show Gist options
  • Save drhayes/4076717 to your computer and use it in GitHub Desktop.
Save drhayes/4076717 to your computer and use it in GitHub Desktop.
Base class for behaviors.
ig.module(
'game.behaviors.baseBehavior'
)
.requires(
'impact.impact'
)
.defines(function() {
BaseBehavior = ig.Class.extend({
enabled: true,
init: function() {
this.id = _.uniqueId('behavior-');
},
// Called when the behavior is added to an entity.
added: function(entity) {},
// Called when the behavior is removed from an entity.
removed: function(entity) {}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment