Warning: The magic method EDD_Blocks::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/edd-blocks-master/edd-blocks.php on line 101

Warning: The magic method EDD_Blocks::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/edd-blocks/edd-blocks.php on line 101

Warning: The magic method GAINWP_Manager::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/gainwp.php on line 78

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 555

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 585

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 617

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 651

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 686

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 745

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 785
Phaser 3 TileMap Snippets - Phaser Games

Phaser 3 TileMap Snippets


Notice: Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.) in /home/wcc1969/public_html/phasergames.com/wp-includes/functions.php on line 6085

Notice: Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.) in /home/wcc1969/public_html/phasergames.com/wp-includes/functions.php on line 6085

Warning: Undefined variable $output in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/wc_snippets/snippets.php on line 110
create tile map
Description:creates a tilemap object
Example:const map = this.make.tilemap({ key: "map", tileWidth: 16, tileHeight: 16 });

Add Tileset Images
Description:adds the images needed to the map
Example:map.addTilesetImage("tiles");

Add Layer to Map
Description:adds a static layer to a map. This will allow you to put images below, above, or on the same index as the player.
Example:const layer = map.createLayer(0, tileset, 0, 0);

Load Tiled JSON
Description:Loads a JSON file to use for layer data
Example:this.load.tilemapTiledJSON("map", "town.json");

create tilemap from an array
Description:creates a tilemap object using a 2D array myArray=[[0,1,2],[3,4,5],[3,2,1]]
Example:const map = this.make.tilemap({ data: myArray, tileWidth: 16, tileHeight: 16 });

Add Tileset Images with Json
Description:adds the images needed to the map
Example: const tileset = map.addTilesetImage("Tiles1",'ts');