Hey Phaser amigos. I have a very specific case and maybe you could help me understand what am I doing wrong.
I have this layer with ropes:
It has been created this way:
game.ropeTiles = game.map.addTilesetImage('tiles');
game.ropeLayer = game.map.createDynamicLayer('Ropes', game.ropeTiles, 0, 0);
What I’m trying to do is to know when the player overlaps with this layer so I can hang the monkey to the rope.
I tried something like this:
game.physics.add.overlap(game.player, game.ropeLayer, function(thePlayer, tile) {
console.log('overlaping:', tile);
});
But it’s constantly returning the console log, not just when overlaping.
So two questions:
- Overlapping with Layers works this way?
- Should I create my ropes as another type of instance? maybe objects?
Thanks a lot friends, have a great day!