Phaser API Documentation

  Version: 
softBody(x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, [particleOptions], [constraintOptions])

Description:

Creates a simple soft body like object.

Parameters:

name type arguments description
x number

The horizontal position of this composite in the world.

y number

The vertical position of this composite in the world.

columns number

The number of columns in the Composite.

rows number

The number of rows in the Composite.

columnGap number

The distance between each column.

rowGap number

The distance between each row.

crossBrace boolean

true to create cross braces between the bodies, or false to create just straight braces.

particleRadius number

The radius of this circlular composite.

particleOptions Phaser.Types.Physics.Matter.MatterBodyConfig <optional>

An optional Body configuration object that is used to set initial Body properties on creation.

constraintOptions Phaser.Types.Physics.Matter.MatterConstraintConfig <optional>

An optional Constraint configuration object that is used to set initial Constraint properties on creation.

Returns:
Description:

A new composite simple soft body.

Type:
  • MatterJS.CompositeType
Since: 3.0.0