Meeeeeeeh Posted November 17, 2015 Share Posted November 17, 2015 Whenever I try to use a tilemap from Tiled, it never shows up in my browser. All I see is a black screen. As I'm relatively new to this, I've tried following along with tutorials and examples about how to use tilemaps with Phaser, but no matter what, it never seems to work. Does anyone know what the problem could be? I use Brackets.<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Insert Title Here</title> <script src="phaser.min.js"></script> <style type="text/css"> body { margin: 0; } </style></head><body><script type="text/javascript">var game = new Phaser.Game(640, 640, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var map;var backgroundLayer;var blockLayer; function preload(){ game.load.tilemap('myTilemap', 'assets/scifi.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('myTileset', 'assets/scifi_platformTiles_32x32.png');} function create(){ map = this.add.tilemap('myTilemap'); map.addTilesetImage('scifi_platformTiles_32x32', 'myTileset'); backgroundLayer = map.createLayer('background'); blockLayer = map.createLayer('blocklayer');} function update(){ } </script></body></html>Also, my Google Chrome console displays this: Uncaught TypeError: Cannot read property '0' of undefined phaser.min.js:25 Link to comment Share on other sites More sharing options...
jmp909 Posted November 18, 2015 Share Posted November 18, 2015 Set your map format to CSV and export as json Link to comment Share on other sites More sharing options...
forkgame Posted November 19, 2015 Share Posted November 19, 2015 from my experience, Tile Map software use compression for tiled map in the default. change it to no compression solve the problem for me. it's on Map -> Properties Link to comment Share on other sites More sharing options...
Recommended Posts