Open crazy2be opened 11 years ago
So jQuery.clone() should be able to go away:
./game/towerAttackType.js: var newAttTemplate = cloneObject(attackTemplate); //Clone it just incase it has its own attributes
./game/towerAttackType.js: var dist = cloneObject(start);
./game/towerAttackType.js: start = cloneObject(end);
./game/towerAttackType.js: start = cloneObject(end);
./game/towerAttackType.js: start = cloneObject(end);
./game/tower.js: var dis = cloneObject(t1.tpos.center());
./game/commonFncs.js:function cloneObject(object) {
Almost everywhere it's used is an error, (or at least looks that way), and the first case can be supplanted by a simple clone method.
mergeObject is actually completely unused.
And we should be able to replace jQuery.isFunction with a simple typeof
check: http://stackoverflow.com/questions/5999998/how-can-i-check-if-a-javascript-variable-is-function-type
Right now, jQuery takes ~97kb of bandwidth on first load, out of a total page weight of ~347kb. I rewrote InputHandler to not rely on jQuery anymore, so the only dependencies in our code should be for a handful of utility functions, like jQuery.clone(), jQuery.merge(), and jQuery.isFunction(). We should be able to steal just these functions from the jQuery source, or remove our dependency on them if we no longer need them (jQuery.clone(), in particular, used to be used a lot for Rects and Vectors, but I'm not sure if it's used anymore).