mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Added Math.isEven and isEvenStrict
This commit is contained in:
parent
eddb17f5a6
commit
65e2deb203
4 changed files with 17 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: '3742be10-5b7d-11e7-8005-ef6dcee762ca'
|
||||
build: 'f2d24020-5b86-11e7-923f-e7e69f9cb7f2'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
7
v3/src/math/IsEven.js
Normal file
7
v3/src/math/IsEven.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
var IsEven = function (value)
|
||||
{
|
||||
// Use abstract equality == for "is number" test
|
||||
return (value == parseFloat(value)) ? !(value % 2) : void 0;
|
||||
};
|
||||
|
||||
module.exports = IsEven;
|
7
v3/src/math/IsEvenStrict.js
Normal file
7
v3/src/math/IsEvenStrict.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
var IsEvenStrict = function (value)
|
||||
{
|
||||
// Use strict equality === for "is number" test
|
||||
return (value === parseFloat(value)) ? !(value % 2) : void 0;
|
||||
};
|
||||
|
||||
module.exports = IsEvenStrict;
|
|
@ -34,6 +34,8 @@ module.exports = {
|
|||
FloatBetween: require('./FloatBetween'),
|
||||
FloorTo: require('./FloorTo'),
|
||||
GetSpeed: require('./GetSpeed'),
|
||||
IsEven: require('./IsEven'),
|
||||
IsEvenStrict: require('./IsEvenStrict'),
|
||||
Linear: require('./Linear'),
|
||||
MaxAdd: require('./MaxAdd'),
|
||||
MinSub: require('./MinSub'),
|
||||
|
|
Loading…
Reference in a new issue