Problem using excalibur-tiled with Parcel

88 views
Skip to first unread message

Andre Dantas

unread,
Jul 21, 2019, 12:32:48 PM7/21/19
to excaliburjs
Hello friends,

I've just started using Excalibur and I'm finding it an awesome engine, but I've had some problems adding my tiled map into my game.

When importing my json file like this: import mapJson from '../assets/data/maps/map.json'; I get an object, instead of a path that I can use to instanciate TiledResource.

The same issue ocurred when using the example-ts-webpack boilerplate.

After a while, I decided to reimplement the getTileMap method from the plugin directly in my game, but the game fails to load when I add the tilemap into the scene. I think I get an infinite loop somewhere because Firefox hangs.

Does anyone knows what might be happening?

Thanks.

Cheers.
Andre D.

Kamran Ayub

unread,
Jul 21, 2019, 3:05:06 PM7/21/19
to Andre Dantas, excaliburjs
Hi Andre,

Tiled maps should be used as game resources, not necessarily as imported JSON (though that might be nice in the future).

So basically you can use ex.Tiled.Resource or whatever the sample shows to load via relative path (pass to Loader) and it'll create the data structure and TileMap for you. 

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/b30a3a8c-1269-48bb-adba-ca5704222bdb%40googlegroups.com.

Andre Dantas

unread,
Jul 22, 2019, 11:06:49 AM7/22/19
to excaliburjs
Makes sense, but I'm wondering if there's something else wrong.

Even when importing as a path, or reimplementing the getTileMap function for the object, I get the same tile map object, with the same TileSprites in them.
But on both occasions the loading screen hangs when I add these tile maps to the scene.

I'm starting to think there is a problem when excalibur tries to draw the tile map. I'll try to go thru the draw method and see where it's breaking.

On Sunday, July 21, 2019 at 3:05:06 PM UTC-4, Kamran Ayub wrote:
Hi Andre,

Tiled maps should be used as game resources, not necessarily as imported JSON (though that might be nice in the future).

So basically you can use ex.Tiled.Resource or whatever the sample shows to load via relative path (pass to Loader) and it'll create the data structure and TileMap for you. 

On Sun, Jul 21, 2019, 11:32 AM Andre Dantas <andre.d...@gmail.com> wrote:
Hello friends,

I've just started using Excalibur and I'm finding it an awesome engine, but I've had some problems adding my tiled map into my game.

When importing my json file like this: import mapJson from '../assets/data/maps/map.json'; I get an object, instead of a path that I can use to instanciate TiledResource.

The same issue ocurred when using the example-ts-webpack boilerplate.

After a while, I decided to reimplement the getTileMap method from the plugin directly in my game, but the game fails to load when I add the tilemap into the scene. I think I get an infinite loop somewhere because Firefox hangs.

Does anyone knows what might be happening?

Thanks.

Cheers.
Andre D.

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excal...@googlegroups.com.

Grégoire Hazette

unread,
Nov 8, 2019, 3:51:44 PM11/8/19
to excaliburjs
I have the same problem I can load the tiled map alone but for the exemple if I add an actor the page freeze, it's look like a infinite loop

Erik Onarheim

unread,
Nov 15, 2019, 7:45:20 AM11/15/19
to excaliburjs
Thanks for posting Gregoire, this does not seem right, can you post an issue with reproduction steps https://github.com/excaliburjs/Excalibur/issues

DaVince

unread,
Feb 9, 2020, 2:13:27 PM2/9/20
to excaliburjs
I've been running into this issue and decided to minimize the amount of code needed to make the crash happen. Bug report filed at https://github.com/excaliburjs/Excalibur/issues/1418

Op vrijdag 15 november 2019 06:45:20 UTC-6 schreef Erik Onarheim:

DaVince

unread,
May 13, 2020, 8:12:36 AM5/13/20
to excaliburjs
Oh yeah, just a quick FYI, but this has been resolved a little while back. :)
Reply all
Reply to author
Forward
0 new messages