Jump to content

Phaser-Tiled-Extras


nkholski
 Share

Recommended Posts

I'm working on a plugin for Phaser adding extra features defined from Tiled. The plugin adds some official features that Phaser currently lacks, but focus on sharing some custom solutions that I found useful in my own projects. An aim is to make it integrate to Phaser 2 and unmodified projects as seamless as possible.

 

It currently supports:

  • Triggers: Triggers defined in an Object layer in Tiled.
  • Tileset properties: Properties set in in tilelayer in Tiled, right now only alpha and collision (including collisionUp etc.).
  • Image layers: Stuff like parallax and properties such as opacity/alpha.
 

The plugin is still under kind of experimental development. I invite anyone to test it however, and to provide feedback or even fork it. Triggers and Tileset properties is probably quite finished when it comes to choice of property names in Tiled and behavior in Phaser. I probably need to rethink a couple of things in Image Layers which might change its behavior. 

 



 

(The plugin will not improve performance. For increased performance (along with extended Tiled support), Phaser-Tiled is the choice for you: https://github.com/englercj/phaser-tiled.)

Link to comment
Share on other sites

  • 2 weeks later...

I've updated the plugin a few times since the post above. Yesterday I added "Phaser.Tilemap.setCollisionLayer" that adds a new layer combining all other layers' collision data. Using this you can focus on the visual layers in Tiled and automatically get one collision layer to check against in your game whatever the number of layers you use. I also updated the example a bit.

 

Is anyone using the plugin? Feedback? Suggestions? Please say something :-)

Link to comment
Share on other sites

Cool project! The plugin adds two methods that you could use for this:

1. Phaser.TilemapLayer.updateCollisionLayer that do what your "generateCollisionMap"-function do but with support for collideUp/Down/Left/Right (could be used for a one way passage etc), and it can be called to clear collision data as well as defining collisions in a limited area too.

2. Phaser.Tilemap.setCollisionLayer will loop through all layers and create a new layer just for collision checks, which is useful when you have multiple layers with collision data and want to reduce the collision checks. (The collisions must be set in the other layers first, by Phaser.TilemapLayer.updateCollisionLayer or any other way.)

 

I think for a RPG the Trigger-stuff could prove really useful. The online demo have two trigger examples. (And I guess that the image layer support could be useful as well for adding stuff like clouds floating above a world map etc).
 

I might split up the plugin into separate plugins, at least the trigger part as I plan to implement a few ideas that has nothing to do with Tiled.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...