Group#subAll()

subAll(property, amount, checkAlive, checkVisible)

Subtracts the amount from the given property on all children in this group.

Group.subAll('x', 10) will minus 10 from the child.x value for each child.

Parameters
Name Type Description
property string

The property to decrement, for example 'body.velocity.x' or 'angle'.

amount number

The amount to subtract from the property. If child.x = 50 then subAll('x', 40) would make child.x = 10.

checkAlive boolean

If true the property will only be changed if the child is alive.

checkVisible boolean

If true the property will only be changed if the child is visible.

Source code: core/Group.js (Line 1403)
doc_phaser
2017-02-14 10:51:50
Comments
Leave a Comment

Please login to continue.