Added Math.numberArray

This commit is contained in:
Richard Davey
2013-09-18 14:07:37 +01:00
parent 47834ad478
commit cf26f68693
2 changed files with 22 additions and 1 deletions
+2 -1
View File
@@ -35,9 +35,10 @@ Phaser is everything we ever wanted from an HTML5 game framework. It will power
Change Log
----------
Version 1.0.5 (September 19th 2013)
Version 1.0.5 (In progress)
* Fixed issue in FrameData.getFrameIndexes where the input array was being ignored.
* Added Math.numberArray - Returns an Array containing the numbers from min to max (inclusive), useful for animation frame construction.
Version 1.0.4 (September 18th 2013)
+20
View File
@@ -323,6 +323,26 @@ Phaser.Math = {
}
}
},
/**
* Returns an Array containing the numbers from min to max (inclusive)
*
* @param min The minimum value the array starts with
* @param max The maximum value the array contains
* @return The array of number values
*/
numberArray: function (min, max) {
var result = [];
for (var i = min; i <= max; i++)
{
result.push(i);
}
return result;
},
/**