applyForceToSprite(id,layer,properties) , method of scene

Apply a constant force to an existing physical sprite in the world.

The force has 2 components:

If force components are omitted then their value is zero.

Parameters:
name type description
layer int layer of the world (must be >= 0)
id int the identifier
properties …Object each with parameter values

TODO add ref to force parameters.

// change the height of Sprite 1 on layer 0

UB.scene.applyForceToSprite(0,1,{fx:0, fy:100, tx:0, ty:0});

See all methods of the api.