To be honest, using the .attr property(?) is sorta annoying to use. Why not have it a function? It only takes up to 4 integers, so I think using it as .attr(x, y, w, h) would be much easier to use. Example:
var player = Crafty.e('2D, Canvas, Color, Fourway, Collision')
.attr(200, 200, 10, 10)
// Other properties...
And then calling any additional properties as:
.props({
currHealth: 100
maxHealth: 100
// Other custom properties...
})
Would this work, or no?
To be honest, using the
.attrproperty(?) is sorta annoying to use. Why not have it a function? It only takes up to 4 integers, so I think using it as.attr(x, y, w, h)would be much easier to use. Example:And then calling any additional properties as:
Would this work, or no?