Sets the bounce values of this body.
Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. |
||
y | number | <optional> | x |
The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. |
This Game Object.
Sets the horizontal bounce value for this body.
name | type | description |
---|---|---|
value | number |
The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. |
This Game Object.
Sets the vertical bounce value for this body.
name | type | description |
---|---|---|
value | number |
The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. |
This Game Object.
Sets whether this Body collides with the world boundary.
Optionally also sets the World Bounce values. If the Body.worldBounce
is null, it's set to a new Phaser.Math.Vector2 first.
name | type | arguments | Default | description |
---|---|---|---|---|
value | boolean | <optional> | true |
|
bounceX | number | <optional> |
If given this will be replace the |
|
bounceY | number | <optional> |
If given this will be replace the |
|
onWorldBounds | boolean | <optional> |
If given this replaces the Body's |
This Game Object.