2017-01-22 22:54:06 +00:00
|
|
|
|
|
|
|
var Blitter = require('./Blitter');
|
|
|
|
var FactoryContainer = require('../../gameobjects/FactoryContainer');
|
|
|
|
|
|
|
|
var BlitterFactory = {
|
|
|
|
|
|
|
|
KEY: 'blitter',
|
|
|
|
|
2017-02-24 02:59:33 +00:00
|
|
|
add: function (x, y, key, frame, parent)
|
2017-01-22 22:54:06 +00:00
|
|
|
{
|
2017-02-24 02:59:33 +00:00
|
|
|
if (parent === undefined) { parent = this.state; }
|
2017-01-22 22:54:06 +00:00
|
|
|
|
2017-02-24 02:59:33 +00:00
|
|
|
return parent.children.add(new Blitter(this.state, x, y, key, frame));
|
2017-01-22 22:54:06 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
make: function (x, y, key, frame)
|
|
|
|
{
|
|
|
|
return new Blitter(this.state, x, y, key, frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = FactoryContainer.register(BlitterFactory);
|