Jump to content

Beginner problem with Tilemaps


DudeshootMankill
 Share

Recommended Posts

Hey guys i've got a weird problem with tilemaps.

In the create function i've got this:

this.collisionLayer = this.map.createLayer('CollisionLayer');
this.ladderLayer = this.map.createLayer('LadderLayer');

this.collisionLayer.resizeWorld();

this.map.setCollisionByExclusion([0 ]);

and in the update function:

this.game.physics.arcade.collide(this.player, this.collisionLayer);

this works just fine, and the player collides with the collisionLayer and so on.

However if i do this:

this.game.physics.arcade.collide(this.player, this.ladderLayer);

Nothing happens. I can collide perfectly fine with the ground in my small level. But the exact same code doesnt work for the ladderLayer.

I've attached the file beneath if anyone would be so kind as to take a gander. Thanks for your time.

firstMap.js

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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