Force

Force

A vector used to move objects.

Constructor

new Force(x, y, multiplier)

Parameters:
Name Type Description
x

The initial x component

y

The initial y component

multiplier

The multiplier (0 for a force that disappear on next frame, 1 for a permanent force)

Source:

Methods

getAngle()

Get the angle of the force

Source:

getLength()

Get the length of the force

Source:

getMultiplier()

Return 1 (true) if the force is permanent, 0 (false) if it is instant.

Source:

getX()

Returns the X component of the force.

Source:

getY()

Returns the Y component of the force.

Source:

setAngle(angle)

Set the angle of the force.

Parameters:
Name Type Description
angle

The new angle

Source:

setLength(len)

Set the length of the force.

Parameters:
Name Type Description
len

The length

Source:

setMultiplier(multiplier)

Set if the force multiplier.

Parameters:
Name Type Description
multiplier

The new value

Source:

setX(x)

Set the x component of the force.

Parameters:
Name Type Description
x

The new X component

Source:

setY(y)

Set the y component of the force.

Parameters:
Name Type Description
y

The new Y component

Source: