Sets the velocity of the Body.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The horizontal velocity of the body, in pixels per second. Positive values move the body to the right, while negative values move it to the left. |
||
y | number | <optional> | x |
The vertical velocity of the body, in pixels per second. Positive values move the body down, while negative values move it up. |
This Game Object.
Sets the horizontal component of the body's velocity.
Positive values move the body to the right, while negative values move it to the left.
name | type | description |
---|---|---|
x | number |
The new horizontal velocity, in pixels per second. |
This Game Object.
Sets the vertical component of the body's velocity.
Positive values move the body down, while negative values move it up.
name | type | description |
---|---|---|
y | number |
The new vertical velocity, in pixels per second. |
This Game Object.
Sets the maximum velocity of the body.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The new maximum horizontal velocity, in pixels per second. |
||
y | number | <optional> | x |
The new maximum vertical velocity, in pixels per second. |
This Game Object.