davidwesst

Members
  • Content Count

    2
  • Joined

  • Last visited

About davidwesst

  • Rank
    Newbie

Contact Methods

  • Twitter
    davidwesst
  1. You were right! It appears that Phaser.TypeScript.objects contains my object layer and names it accordingly. I changed my code to use map.objects['objects'] (or map.objects['cats']) and everything is working as expected. Thank you!
  2. Hello everyone, I'm working on a small game using TypeScript, and I hit a compilation issue with the Phaser.Tilemap object. I was going to submit it as an issue to GitHub, but because I'm new here I wanted to error on the side of caution and make sure that this is actually an issue, as per the contribution guidelines. According to the phaser.d.ts file, on [line 5057](https://github.com/photonstorm/phaser-ce/blob/master/typescript/phaser.d.ts#L5057), the objects project is supposed to be an any[]. When running my application, I can see that Phaser.Tilemap.objects is an Object, with another property called objects, which is an any[]. I have attached a screenshot of my code editor watch expressions that shows the issue I'm facing. If we make the following change to the def file, it would resolve the issue. I have confirmed the change in my local repository, and everything appears to compile as expected. objects: { objects: any[]; }; To generate the error, I am loading TILED_JSON map data and iterating through it to find a specific tile, as follows: let map: Phaser.Tilemap for(let o of map.objects.objects) { if(o.type === "start") { start = new Phaser.Point(o.x, o.y - map.tileHeight); break; } }