Search the Community

Showing results for tags 'object-layer'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. This is how I load the tilemap, instantiate a background layer and get the object layer for it: // preload levelgame.load.tilemap( "tilemap", "assets/levels/tilemap.json", null, Phaser.Tilemap.TILED_JSON );game.load.image( "tiles", "assets/levels/tileset.png" );var map = game.add.tilemap( 'tilemap' );map.addTilesetImage('tile-set', 'tiles');// create background layervar layer = map.createLayer( backgroundLayerName );// get objects from the object layervar levelObjects = map.objects[ objectsLayerName ];levelObjects.forEach( function( element ) { //...} );I get the position and name properties, but there is no rotation. I've made sure tiliemap.json has the rotation values for every object. I am trying to use the Arcade physics engine, could this be the reason? Thanks.
  2. As usual, I will begin with my tilemap: As you can see I added three objects that I want to use in my map as triggers. This is the object layer called Triggers in tiled. I did not change my loading code because I assumed that you don't have to load the object layer: constructor(game: Phaser.Game, key: string, manifest: any) { super(game, key); this.addTilesets(manifest.maze); this.wallLayer = this.createLayer(this.WallsLayer); this.backgroundLayer = this.createLayer(this.BackgroundLayer); this.shadowLayer = this.createLayer(this.ShadowsLayer); this.itemLayer = this.createLayer(this.ItemsLayer); this.objectLayer = this.createLayer(this.ObjectsLayer); this.creatureLayer = this.createLayer(this.CreaturesLayer); this.separateCreaturesFromTilemap(); this.separateItemsFromTilemap(); this.backgroundLayer.resizeWorld(); this.setCollisionBetween(1, 2, true, "Walls"); }And this fails at runtime with the exception: Uncaught TypeError: Cannot read property 'length' of undefined phaser.js:64576 Phaser.TilemapParser.parseTiledJSON phaser.js:64576 Phaser.TilemapParser.parse phaser.js:64260 Phaser.Tilemap phaser.js:61637 Tilemap Tilemap.ts:23 InGame.initializeMap InGame.ts:36InGame.create InGame.ts:26 Phaser.StateManager.loadComplete phaser.js:17993 Phaser.StateManager.preUpdate phaser.js:17753 Phaser.Game.update phaser.js:24518 Phaser.RequestAnimationFrame.updateRAF phaser.js:42978 _onLoopFinally, here is the object layer as it is defined in the .json: { "draworder":"topdown", "height":8, "name":"Triggers", "objects":[ { "height":0, "name":"warp", "properties": { "map":"volcano" }, "rotation":0, "type":"", "visible":true, "width":0, "x":60, "y":12 }, { "height":0, "name":"warp", "properties": { "map":"desert" }, "rotation":0, "type":"", "visible":true, "width":0, "x":276, "y":60 }, { "height":0, "name":"spawn_player", "properties": { }, "rotation":0, "type":"", "visible":true, "width":0, "x":60, "y":36 }], "opacity":1, "type":"objectgroup", "visible":true, "width":12, "x":0, "y":0 }