2017-05-19 19:07:30 +00:00
|
|
|
var Quad = require('./Quad');
|
|
|
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
|
|
|
var BuildGameObject = require('../BuildGameObject');
|
|
|
|
|
2017-07-04 00:59:31 +00:00
|
|
|
var QuadCreator = function (state, config)
|
2017-05-19 19:07:30 +00:00
|
|
|
{
|
2017-05-23 12:29:40 +00:00
|
|
|
var x = GetAdvancedValue(config, 'x', 0);
|
|
|
|
var y = GetAdvancedValue(config, 'y', 0);
|
2017-05-19 19:07:30 +00:00
|
|
|
var key = GetAdvancedValue(config, 'key', null);
|
|
|
|
var frame = GetAdvancedValue(config, 'frame', null);
|
|
|
|
|
2017-05-23 12:29:40 +00:00
|
|
|
var quad = new Quad(state, x, y, key, frame);
|
2017-05-19 19:07:30 +00:00
|
|
|
|
|
|
|
BuildGameObject(state, quad, config);
|
|
|
|
|
|
|
|
return quad;
|
|
|
|
};
|
|
|
|
|
2017-07-04 00:59:31 +00:00
|
|
|
module.exports = QuadCreator;
|