Skip to content

Commit a70fb6a

Browse files
committed
Add docs for Arcade Physics
1 parent c9ea4dc commit a70fb6a

4 files changed

Lines changed: 381 additions & 296 deletions

File tree

src/physics/arcade/ArcadePhysics.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ var ArcadePhysics = new Class({
229229
},
230230

231231
/**
232-
* Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.)
232+
* Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared)
233233
*
234234
* You must give a maximum speed value, beyond which the game object won't go any faster.
235235
*
@@ -242,7 +242,7 @@ var ArcadePhysics = new Class({
242242
* @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.
243243
* @param {number} x - The x coordinate to accelerate towards.
244244
* @param {number} y - The y coordinate to accelerate towards.
245-
* @param {number} [speed=60] - The speed it will accelerate in pixels per second.
245+
* @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared.
246246
* @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach.
247247
* @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach.
248248
*
@@ -265,7 +265,7 @@ var ArcadePhysics = new Class({
265265
},
266266

267267
/**
268-
* Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.)
268+
* Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared)
269269
*
270270
* You must give a maximum speed value, beyond which the game object won't go any faster.
271271
*
@@ -277,7 +277,7 @@ var ArcadePhysics = new Class({
277277
*
278278
* @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.
279279
* @param {Phaser.GameObjects.GameObject} destination - The Game Object to move towards. Can be any object but must have visible x/y properties.
280-
* @param {number} [speed=60] - The speed it will accelerate in pixels per second.
280+
* @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared.
281281
* @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach.
282282
* @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach.
283283
*
@@ -289,7 +289,7 @@ var ArcadePhysics = new Class({
289289
},
290290

291291
/**
292-
* From a set of points or display objects, find the one closest to a source point or object.
292+
* Finds the Body closest to a source point or object.
293293
*
294294
* @method Phaser.Physics.Arcade.ArcadePhysics#closest
295295
* @since 3.0.0
@@ -323,7 +323,7 @@ var ArcadePhysics = new Class({
323323
},
324324

325325
/**
326-
* From a set of points or display objects, find the one farthest from a source point or object.
326+
* Finds the Body farthest from a source point or object.
327327
*
328328
* @method Phaser.Physics.Arcade.ArcadePhysics#furthest
329329
* @since 3.0.0
@@ -417,14 +417,14 @@ var ArcadePhysics = new Class({
417417
},
418418

419419
/**
420-
* Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
421-
* One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.
420+
* Given the angle (in degrees) and speed calculate the velocity and return it as a vector, or set it to the given vector object.
421+
* One way to use this is: velocityFromAngle(angle, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object.
422422
*
423423
* @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromAngle
424424
* @since 3.0.0
425425
*
426426
* @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)
427-
* @param {number} [speed=60] - The speed it will move, in pixels per second sq.
427+
* @param {number} [speed=60] - The speed it will move, in pixels per second squared.
428428
* @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity.
429429
*
430430
* @return {Phaser.Math.Vector2} The Vector2 that stores the velocity.
@@ -438,14 +438,14 @@ var ArcadePhysics = new Class({
438438
},
439439

440440
/**
441-
* Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
442-
* One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.
441+
* Given the rotation (in radians) and speed calculate the velocity and return it as a vector, or set it to the given vector object.
442+
* One way to use this is: velocityFromRotation(rotation, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object.
443443
*
444444
* @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromRotation
445445
* @since 3.0.0
446446
*
447447
* @param {number} rotation - The angle in radians.
448-
* @param {number} [speed=60] - The speed it will move, in pixels per second sq.
448+
* @param {number} [speed=60] - The speed it will move, in pixels per second squared
449449
* @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity.
450450
*
451451
* @return {Phaser.Math.Vector2} The Vector2 that stores the velocity.

0 commit comments

Comments
 (0)