splat-ecs
Version:
A 2D HTML5 Canvas game engine
21 lines (19 loc) • 508 B
JavaScript
/**
* The size of an entity in the game world.
* @typedef {Object} size
* @memberof Components
* @property {float} width - The width of this entity rightward from {@link Components.position} along the x-axis.
* @property {float} height - The height of this entity downward from {@link Components.position} along the y-axis.
*/
module.exports = {
factory: function() {
return {
width: 0,
height: 0
};
},
reset: function(size) {
size.width = 0;
size.height = 0;
}
};