Phaser API Documentation

  Version: 
<static> Shuffle(tileX, tileY, width, height, layer)

Description:

Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given layer. It will only randomize the tiles in that area, so if they're all the same nothing will appear to have changed! This method only modifies tile indexes and does not change collision information.

Parameters:

name type description
tileX number

The left most tile index (in tile coordinates) to use as the origin of the area.

tileY number

The top most tile index (in tile coordinates) to use as the origin of the area.

width number

How many tiles wide from the tileX index the area will be.

height number

How many tiles tall from the tileY index the area will be.

layer Phaser.Tilemaps.LayerData

The Tilemap Layer to act upon.

Since: 3.0.0