File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 */
66
77/**
8- * Calculate the speed required to cover a distance in the time given.
8+ * Calculate a per-ms speed from a distance and time ( given in seconds) .
99 *
1010 * @function Phaser.Math.GetSpeed
1111 * @since 3.0.0
1212 *
13- * @param {number } distance - The distance to travel in pixels .
14- * @param {integer } time - The time, in ms, to cover the distance in .
13+ * @param {number } distance - The distance.
14+ * @param {integer } time - The time, in seconds .
1515 *
16- * @return {number } The amount you will need to increment the position by each step in order to cover the distance in the time given.
16+ * @return {number } The speed, in distance per ms.
17+ *
18+ * @example
19+ * // 400px over 1 second is 0.4 px/ms
20+ * Phaser.Math.GetSpeed(400, 1) // -> 0.4
1721 */
1822var GetSpeed = function ( distance , time )
1923{
You can’t perform that action at this time.
0 commit comments