Jump to content

Phaser 3, TilemapLayer to overlap physics sprite


virginsteele
 Share

Recommended Posts

Hi All,

I'm new to phaser (using phaser 3.50.1) and trying to generate random objects around the level.

The problem is I don't want these objects to be spawned over on the tilemapLayer tiles. Attached is an image of the stars spawning over the tiles.

 

Before I added the tileMap, I was using

this.physics.add.staticGroup();

with that I was able to check on the overlap with the walls in my method to add stars.

this.scene.physics.overlap(wallsstar)

Now, with the tileset, I'm passing the tileMapLayer, but overlap is not detecting the tiles (picture, line 29)

How is the correct way to check for collisions/overlaps for tileMaps ?

question1.thumb.jpg.750f346612237d5ddef4b6557e6a4a7e.jpg

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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