Math#max()

max() → {number} Variation of Math.max that can be passed either an array of numbers or the numbers as parameters. Prefer the standard Math.max function when appropriate. Returns number - The largest value from those given. Source code: math/Math.js (Line 635) See http://jsperf.com/math-s-min-max-vs-homemade

Math#Math

new Math() A collection of useful mathematical functions. These are normally accessed through game.math. Source code: math/Math.js (Line 17) See Phaser.Utils Phaser.ArrayUtils

Math#mapLinear()

mapLinear(x, a1, a2, b1, b2) → {number} Linear mapping from range to range Parameters Name Type Description x number The value to map a1 number First endpoint of the range a2 number Final endpoint of the range b1 number First endpoint of the range b2 number Final endpoint of the range Returns number - Source code: math/Math.js (Line 1085)

Math#linearInterpolation()

linearInterpolation(v, k) → {number} A Linear Interpolation Method, mostly used by Phaser.Tween. Parameters Name Type Description v Array The input array of values to interpolate between. k number The percentage of interpolation, between 0 and 1. Returns number - The interpolated value Source code: math/Math.js (Line 741)

Math#linear()

linear(p0, p1, t) → {number} Calculates a linear (interpolation) value over t. Parameters Name Type Description p0 number p1 number t number A value between 0 and 1. Returns number - Source code: math/Math.js (Line 831)

Math#isOdd()

isOdd(n) → {boolean} Returns true if the number given is odd. Parameters Name Type Description n integer The number to check. Returns boolean - True if the given number is odd. False if the given number is even. Source code: math/Math.js (Line 575)

Math#isEven()

isEven(n) → {boolean} Returns true if the number given is even. Parameters Name Type Description n integer The number to check. Returns boolean - True if the given number is even. False if the given number is odd. Source code: math/Math.js (Line 589)

Math#getShortestAngle()

getShortestAngle(angle1, angle2) → {number} Gets the shortest angle between angle1 and angle2.Both angles must be in the range -180 to 180, which is the same clampedrange that sprite.angle uses, so you can pass in two sprite angles tothis method, and get the shortest angle back between the two of them. The angle returned will be in the same range. If the returned angle isgreater than 0 then it's a counter-clockwise rotation, if < 0 then it'sa clockwise rotation. Parameters Name Type Descr

Math#fuzzyLessThan()

fuzzyLessThan(a, b, epsilon) → {boolean} a is fuzzyLessThan b if it is less than b + epsilon. Parameters Name Type Argument Default Description a number The first number to compare. b number The second number to compare. epsilon number <optional> 0.0001 The epsilon (a small value used in the calculation) Returns boolean - True if a<b+epsilon Source code: math/Math.js (Line 57)

Math#fuzzyGreaterThan()

fuzzyGreaterThan(a, b, epsilon) → {boolean} a is fuzzyGreaterThan b if it is more than b - epsilon. Parameters Name Type Argument Default Description a number The first number to compare. b number The second number to compare. epsilon number <optional> 0.0001 The epsilon (a small value used in the calculation) Returns boolean - True if a>b+epsilon Source code: math/Math.js (Line 74)