mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
Merge pull request #4900 from samme/patch-1
Correct docs for Phaser.Math.GetSpeed()
This commit is contained in:
commit
65efb6bcb7
1 changed files with 8 additions and 4 deletions
|
@ -5,15 +5,19 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Calculate the speed required to cover a distance in the time given.
|
||||
* Calculate a per-ms speed from a distance and time (given in seconds).
|
||||
*
|
||||
* @function Phaser.Math.GetSpeed
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} distance - The distance to travel in pixels.
|
||||
* @param {integer} time - The time, in ms, to cover the distance in.
|
||||
* @param {number} distance - The distance.
|
||||
* @param {integer} time - The time, in seconds.
|
||||
*
|
||||
* @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given.
|
||||
* @return {number} The speed, in distance per ms.
|
||||
*
|
||||
* @example
|
||||
* // 400px over 1 second is 0.4 px/ms
|
||||
* Phaser.Math.GetSpeed(400, 1) // -> 0.4
|
||||
*/
|
||||
var GetSpeed = function (distance, time)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue