phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Respect tiled properties as an array #682

Closed f0rdP3rf3ct closed 3 years ago

f0rdP3rf3ct commented 3 years ago

This PR

Please include a summary in Change Log: Unreleased and thank yourself.

Describe the changes below:

Adaptation of: https://github.com/photonstorm/phaser/commit/fea65988f41e3b66461a4ee8698af9457dac6286

Tiled objects have properties as an array of objects like:

{ name: ..., type: ..., value: ...}

Update the parser to load these using the name/value properties instead of just treating it as an array and loading properties named '0', '1', etc.

sprite.setData does not exist in PhaserCE. therefore the property is set directly on the sprite.