var _ = require('../lib/functions');
var Fabric = require('../lib/fabric');
var game = new Fabric({
spawns: []
});
var template = require('../data/mob');
game.use('tick', function (input) {
var self = this;
console.log('tick!', self.clock);
return input;
});
game.use('spawn', function (input) {
var self = this;
var data = _.clone(template);
data.id = Math.random();
var mob = new Fabric(data);
mob.use('attack', function (target, stack) {
console.log('attack!', target);
console.log('attack stack:', stack);
mob.broadcast('attack', '/spawns/1');