GXEntityVX - boxgaming/gx GitHub Wiki
Gets or sets the horizontal velocity (vx) of the specified entity. The value of the horizontal velocity (vx) is specified as the number of pixels per second. A positive value indicates movement to the right. A negative value indicates movement to the left.
Syntax
GXEntityVX entityId%, vx% vx% = GXEntityVX (entityId%)
Parameters
- Entity for which the horizontal velocity (vx) will be set or returned is specified by the entityId% parameter. This id is returned by the GXEntityCreate function or can be accessed by its user id by the GX function.
- The horizontal velocity is specified by the vx% parameter.
Examples
Example1: Increase the current x velocity by 10 pixels per second.
vx% = GXEntityVX(warhog)
GXEntityVX warhog, vx% + 10
See Also
GXEntityCreate GXEntityX GXEntityY GXEntityMove GXEntityPos GXEntityVY GX