2017-01-24 12:55:45 +00:00
|
|
|
var Bob = function (blitter, x, y, frame, visible)
|
|
|
|
{
|
|
|
|
this.parent = blitter;
|
|
|
|
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
this.frame = frame;
|
2017-02-01 00:43:38 +00:00
|
|
|
this.data = {};
|
2017-02-13 23:57:32 +00:00
|
|
|
|
|
|
|
this._visible = visible;
|
|
|
|
this._alpha = 1;
|
2017-02-03 16:11:31 +00:00
|
|
|
};
|
2017-02-02 16:55:02 +00:00
|
|
|
|
2017-02-13 23:57:32 +00:00
|
|
|
Bob.prototype.constructor = Bob;
|
|
|
|
|
2017-02-03 16:11:31 +00:00
|
|
|
Bob.prototype = {
|
2017-02-13 23:57:32 +00:00
|
|
|
|
2017-02-02 16:55:02 +00:00
|
|
|
reset: function (x, y, frame)
|
|
|
|
{
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
this.frame = frame;
|
2017-02-13 23:57:32 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
destroy: function ()
|
|
|
|
{
|
|
|
|
this.parent = undefined;
|
|
|
|
this.frame = undefined;
|
|
|
|
this.data = undefined;
|
2017-02-02 16:55:02 +00:00
|
|
|
}
|
2017-02-13 23:57:32 +00:00
|
|
|
|
2017-01-24 12:55:45 +00:00
|
|
|
};
|
|
|
|
|
2017-02-13 23:57:32 +00:00
|
|
|
Object.defineProperties(Bob.prototype, {
|
|
|
|
|
|
|
|
visible: {
|
|
|
|
|
|
|
|
enumerable: true,
|
|
|
|
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
return this._visible;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value)
|
|
|
|
{
|
|
|
|
this._visible = value;
|
|
|
|
this.parent.dirty = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
alpha: {
|
|
|
|
|
|
|
|
enumerable: true,
|
|
|
|
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
return this._alpha;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value)
|
|
|
|
{
|
|
|
|
this._alpha = value;
|
|
|
|
this.parent.dirty = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-01-24 12:55:45 +00:00
|
|
|
module.exports = Bob;
|