englercj / phaser-tiled

A tilemap implementation for phaser focusing on large complex maps built with the Tiled Editor.
MIT License
289 stars 31 forks source link

Is it possible to use simple Arcade Physics collision instead of P2? #56

Closed ghost closed 8 years ago

ghost commented 8 years ago

I have a layer called 'Collision' and I paint all boxes red for their collision.

As I am looking over the code here, it seems like convertTiledmap is the only supported method, but this creates p2 bodies.

With Phaser's tile renderer there is a method map.setCollisionBetween(1, 10000, true, collisionLayer); which works, but cannot seem to find something like that

TLDR: Basically I am trying to set the collides property to true on a specific layer named 'Collision', I think I could just go inside the function Tile and put an if statement in there?

englercj commented 8 years ago

Currently P2 is the only engine that we have automatic body creation for. Feel free to put in a PR to add the necessary conversion functions for arcade though.

Adding arcade physics support is tracked in #19.