mirror of
https://github.com/wassname/phaser.git
synced 2026-07-14 01:10:16 +08:00
Tilemap painting example and other smaller updates.
This commit is contained in:
@@ -10,6 +10,20 @@
|
||||
*/
|
||||
Phaser.Utils = {
|
||||
|
||||
shuffle: function (array) {
|
||||
|
||||
for (var i = array.length - 1; i > 0; i--)
|
||||
{
|
||||
var j = Math.floor(Math.random() * (i + 1));
|
||||
var temp = array[i];
|
||||
array[i] = array[j];
|
||||
array[j] = temp;
|
||||
}
|
||||
|
||||
return array;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Javascript string pad http://www.webtoolkit.info/.
|
||||
* pad = the string to pad it out with (defaults to a space)<br>
|
||||
|
||||
Reference in New Issue
Block a user