Commit graph

85 commits

Author SHA1 Message Date
photonstorm
3f30a3d0d2 jsdocs updates. 2015-03-23 10:11:39 +00:00
photonstorm
a69e53f901 Copyright date change. 2015-02-25 03:36:23 +00:00
photonstorm
01a23b7d91 Tween.to now correctly accepts arrays are destination values, which makes the Tween interpolate through each value specified in the array using the defined Tween.interpolation method (see new example, thanks @FridayMarch26th #1619)
Tween.interpolationFunction was using the incorrect context to invoke the function. This is now defined in `TweenData.interpolationFunctionContext` and defaults to `Phaser.Math`. If you provide your own interpolation function then please adjust the context accordingly (thanks @FridayMarch26th #1618)
2015-02-16 12:23:54 +00:00
photonstorm
689501c15c Phaser.Point.angleSq removed. It didn't work so any code relying on it would be broken, and it's unclear what it was meant for (thanks @nextht #1396) 2015-01-05 13:00:07 +00:00
Paul
b3808890b2 RandomDataGenerator seeding fix
Per https://github.com/photonstorm/phaser/issues/1457 the `sow` function
terminates too early on certain false-y values including 0 (and possibly
"").

This changes that, so that 1) only `undefined` and `null` will terminate
the seed sequence processing (this is to maximize backwards compatibility)
and 2) the `length` of the array is honored.

The documentation also reflects the old (and new/altered) behavior.

This is very minor breaking change; hopefully such is mitigated with
leaving in the null/undefined termination.
2014-12-15 00:18:23 -08:00
Paul
fb9eab76e7 Utils - cleanup
- Updated linked documentation

- Also updated `removeRandomItem` per the contract and for consistency with
  `getRandomItem`.
2014-12-01 23:19:32 -08:00
Paul
dab8772de0 Documentation - consistency updates
- Updated `readOnly` doclet to `readonly`

- `array` refined to `type[]`, where such information was immediately
determinable.

- Updated {Any}/{*} to {any}; {...*} is standard exception

- Udated {Object} to {object}
2014-11-30 04:03:35 -08:00
Paul
ae6cba5928 Math/Utils - various cleanup and deprecations/moves
- FIX/CHANGE - Math.wrapAngle over radians; it would convert radians to degrees
  - No internal code relies on unexpected the radians-to-degrees behavior

- Moved additional methods over to ArrayUtils, only marked deprecated in Math

- Removed some private annotations; e.g. linear / factorial public, but bernstein / catmullRom still protected

- Marked additional duplicates deprecated; e.g linearValue, angleLimit

- Documentation updates

- Fixed some accidental "Utils.Arrays" usage (oops!)

- Bumped deprecations from 2.1.4 to 2.2.0
2014-11-11 21:28:25 -08:00
Paul
d941e285a3 Math/Utils - various cleanup and deprecations/moves
- And one last before..
2014-11-09 17:40:54 -08:00
Paul
a35d032238 Math/Utils - various cleanup and deprecations/moves
- Put in the missing changes..
2014-11-09 17:26:07 -08:00
Paul
a6d2da2a8a Math/Utils - various cleanup and deprecations/moves
There are no known breaking changes.

- Timer
  - Uses standard Math.min/Math.max (it's better 2, 3 items).

- Math
  - Updated documentation
  - Marked various Math functions as deprecated, proxying as appropriate
    - Array-based functions -> ArrayUtils
    - RNG-based functions -> Utils
    - Updated core-usage
    - floor/ceil should not be used (alternatives provided)
  - Altered for some equivalencies
  - Also fixes some assorted issues
  - Marked a few internal functions as private

- Utils
  - Moved polyfills to their own file for better visibility
  - Moved array functions to ArrayUtils and marked proxies as deprecated

- Created Phaser.ArrayUtils for array-related functions

- polyfills moved to their own file
  - Functions given function names
  - Added Math.trunc
2014-11-09 16:17:18 -08:00
photonstorm
96fd0ade74 JSDoc fixes. 2014-10-21 22:43:42 +01:00
photonstorm
f2aa263d0a jsdoc fix 2014-10-06 07:00:00 +01:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
photonstorm
3fc527ba53 Added Math.numberArray back in and renamed the replacement to Math.numberArrayStep to avoid breaking the API. 2014-09-09 12:49:17 +01:00
photonstorm
79d873f47b If you are using CocoonJS, please set your game render type to CANVAS and not WEBGL or AUTO. You should also disable any of the ScaleManager screen resizing or margin setting code. By default in this mode CocoonJS will now set 'screencanvas=true' which helps with performance significantly. 2014-09-08 22:34:53 +01:00
Jeremy Dowell
06c6b23454 moved: Utils.range to Math.numberArray 2014-09-05 09:36:36 -05:00
devinb83
2be45e93ae QuadTree leveling Bug
Rather than level++ which changes the current node's level, the subnodes should get the current node's level + 1
2014-07-14 12:55:26 -07:00
Alvin
6f0a9115c4 Made the code jshint-friendly 2014-06-24 11:26:05 +02:00
Alvin
9e2ca08722 Added factorial and changed interpolation docs 2014-06-24 11:23:20 +02:00
photonstorm
7836f3acd9 Added RandomDataGenerator.between (an alias for integerInRange) 2014-06-06 04:12:35 +01:00
photonstorm
78ec29facc RandomDataGenerator.integerInRange would return a non-integer value if you passed in a float. 2014-05-09 16:39:45 +01:00
photonstorm
e06f249d9b Commented out 2 functions that don't currently work. 2014-05-09 16:39:45 +01:00
Richard Davey
570e8acabb Joystick updates. 2014-05-07 18:10:13 +01:00
photonstorm
2b40c8a7c7 Pointer.type and Pointer.exists properties added.
QuadTree.retrieve can now accept either a Sprite with a physics body or a Phaser.Rectangle as its parameter.
ArcadePhysics.getObjectsUnderPointer will return all children from a Group that overlap with the given Pointer.
2014-05-06 02:45:10 +01:00
Gaëtan Renaudeau
1f948d8994 Fix #771: make smoothstep(x,a,b) work if a > b 2014-04-28 15:16:51 +02:00
photonstorm
11ca2deaf6 Finally - fully working setHSL and shiftHSL. 2014-04-25 02:45:35 +01:00
photonstorm
e0f850bc21 jshint fix 2014-04-22 11:33:03 +01:00
photonstorm
06878407e8 RandomDataGenerator.integerInRange uses a new method of rounding the value to an integer to avoid distribution probability issues (thanks PhaserFan) 2014-04-22 11:01:15 +01:00
photonstorm
713bd203ee ArcadePhysics.collideSpriteVsGroup checks if Sprite has a body before carrying on, now safely skips sub-groups or other non-Sprite group children.
QuadTree.retrieve now checks to see if the given Sprite has a body before carrying on.
2014-04-17 12:31:14 +01:00
photonstorm
6979103634 Fix for #732 (Timer.onComplete not firing).
jsdoc updates across Math and InputHandler.
2014-04-16 18:50:54 +01:00
John Watson
27bdbbafaa Fixed Math.atan2 arguments in wrong order
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2
2014-04-14 17:14:31 -07:00
Christian Wesselhoeft
428505f600 Enable jshint immed flag. 2014-03-25 14:56:05 -07:00
Christian Wesselhoeft
61f18b675c Trim trailing whitespace. 2014-03-25 14:56:04 -07:00
photonstorm
eec9f70c1c Math.removeRandom allows you to remove (and return) a random object from an array.
Updated TypeScript defs to fix getRandom (fix #583)
2014-03-18 16:51:58 +00:00
Kimmo Salmela
97a838edbb Added support for radians in wrapAngle
My first time proposing a change in GitHub, so I hope I did it correctly.
2014-03-18 13:40:07 +02:00
photonstorm
c8e63582a4 Lots of small tweaks to pass jshint. 2014-03-13 16:49:52 +00:00
alvinsight
c9f89f5a3b New examples for ninja physics, bitmap text, and documented the map function 2014-03-13 13:25:39 +00:00
photonstorm
cb5a8c7515 Renamed px2p and p2px to: pxm and mpx (px to meters and meters to px). Also removed from Math. 2014-03-12 00:07:27 +00:00
photonstorm
6bddf1a914 The main Game class has been modified so that the update methods no longer have any if/else checks in them. Now split into coreUpdate, etc.
Put QuadTree back into Debug class.
Debug class now clears down on WebGL.
Updated RetroFont.type.
Fixed QuadTree example.
2014-03-11 16:14:01 +00:00
photonstorm
170776ada1 rnd updated so the array picks use length -1 (fixes #541) 2014-03-11 10:56:54 +00:00
photonstorm
8fff38618d Tidied up the Examples, fixed Arcade Physics Body, added Body enable support to Group and fixed QuadTree. 2014-03-10 03:06:28 +00:00
photonstorm
4db1fc0079 Restored Phaser.QuadTree - should get all remaining Arcade Physics examples working again. 2014-03-07 15:14:53 +00:00
photonstorm
8c2502d37d Group.xy(index, x, y) allows you to set the x and y coordinates of a Group child at the given index.
Group.reverse() reverses the display order of all children in the Group.
New labs demo.
Fixed some Easing docs issues.
2014-03-04 01:27:57 +00:00
photonstorm
0eb23d4b11 RandomDataGenerator.integerInRange(min, max) now includes both min and max within its range (#501) 2014-03-02 11:21:30 +00:00
photonstorm
9fcab5ef26 Lots of doc fixes (thanks nhowell) 2014-02-20 03:44:44 +00:00
photonstorm
1d3616f52c Do not invert (physics) shape size data for circle, rectangle, capsuel & line #445 2014-02-19 15:21:03 +00:00
photonstorm
14646e811c QuadTree deprecated and moved to plugins. Body.collideWorldBounds added back and working. CollisionGroups pretty much finished. 2014-02-19 02:12:27 +00:00
photonstorm
5968dd053b CollisionGroup and collision masks working. Need to refine a little, but all the essentials are there. 2014-02-19 01:51:14 +00:00
photonstorm
43d9fc4f52 Fixed issue where loadTexture would sometimes incorrectly try to apply the texture update twice. Also fixed bug in Math.angleBetween. 2014-02-11 04:08:32 +00:00