mirror of
https://github.com/wassname/phaser.git
synced 2026-07-21 12:40:56 +08:00
Started revamp of the Tilemap system. Also removed old 'Advanced Physics' and dropped in p2.js which is what I hope we'll eventually use.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
module.exports = Utils;
|
||||
|
||||
/**
|
||||
* Misc utility functions
|
||||
* @class Utils
|
||||
* @constructor
|
||||
*/
|
||||
function Utils(){};
|
||||
|
||||
/**
|
||||
* Append the values in array b to the array a. See <a href="http://stackoverflow.com/questions/1374126/how-to-append-an-array-to-an-existing-javascript-array/1374131#1374131">this</a> for an explanation.
|
||||
* @method appendArray
|
||||
* @static
|
||||
* @param {Array} a
|
||||
* @param {Array} b
|
||||
*/
|
||||
Utils.appendArray = function(a,b){
|
||||
if (b.length < 150000) {
|
||||
a.push.apply(a, b)
|
||||
} else {
|
||||
for (var i = 0, len = b.length; i !== len; ++i) {
|
||||
a.push(b[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user