I’m trying to make a platformer in arcade physics, as I’m kind of new to Phaser, and I don’t quite want to move to matter yet. My base tile size is 32x32, but I have this tile that is smaller. I have done some searching, and it looks like the way to go is using “createFromTiles,” I have tried to use it, but it still doesn’t seem to be working correctly. This is my code;
Can you elaborate on this? You have many size of tiles? Maybe you should stick to one size and do the different sizes as objects. If you’re using Tiled it is also more practical to use ‘collides’=true in your tileset and then this.rocks.setCollisionByProperty({ collides: true }); This way the tiles you want collide and you don’t have to draw another collision layer. Object layer you should read with createFromObjects but if that’s too limited you can do something like this:
this.tilemapObjects = this.map.objects[0].objects; // access the full object layer
this.tilemapObjects.forEach(function(object) { // fetch stuff phaser can't handle directly
if(object.type == 'something') {
// do something, e.g. create certain sprite or shape with certain properties
// access custom properties set in Tiled
}
}
Also be sure to use Tiled version 1.1.6 since afaik Phaser still doesn’t support the new format.