last day (30 days later) » 

23:00
1
A: Tiled collision editor, object layer in use in Phaser

winner_joinerWell there are many way's to do this, this is one way: get object layer, with the name from Tiled (link to the documentation): // let map = this.make.tilemap( {...} ); let objectLayer = map.getObjectLayer( 'Trees' ); iterate over all objects from that layer (link to the documentation): for( l...

It makes a rectangle over the whole area and doesn't affect where I have added the collision and what its size. I am using arcade physics.
@MohsinUddinAbir yes I know, and that i wrote in the answer. arcade physics just knows boxes and with the setCircle function just circle bodies. if you can work around that limitations you havr to use the matterjs engine.
Can you tell me the easiest way to use it in arcade physics, which contains the exact position and size, with an example? I don't like to change the physics engine to matter js.
The best way to get a circle for an object would be ellipse.setCircle(obj.width/2) sadly no real ellipse is possible. (I also updated the answer)
And armed with this knowledge, I would only create objects Tiled, that are rectangles or circles. (like this you will know how the circular/rectangle body will be in the game)
Error: ellipse.setCircle is not a function.
I don't know why Phaser didn't add an easy way to do it, I got the setCollisionFromCollisionGroup function for TileLayer, but for the ObjectLayer, there don't have like a function.

  last day (30 days later) »