Phaser API Documentation

  Version: 
pyramid(x, y, columns, rows, columnGap, rowGap, callback)

Description:

Create a new composite containing bodies created in the callback in a pyramid arrangement. This function uses the body bounds to prevent overlaps.

Parameters:

name type 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 pyramid.

rows number

The number of rows in the pyramid.

columnGap number

The distance between each column.

rowGap number

The distance between each row.

callback function

The callback function to be invoked.

Returns:
Description:

A Matter JS Composite pyramid.

Type:
  • MatterJS.CompositeType
Since: 3.0.0