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

Apply a one-time force (impuls) 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, e.g. {“fx”:10}.

TODO add ref to force properties.

// change the height of Sprite 1 on layer 0

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

See all methods of the api.