pdiddles03 Posted April 28, 2017 Share Posted April 28, 2017 I have a collision map with a single layer. But i want the character to behave differently when he collides with water than the rest of the tiles. If i have the tile ID of the water, how can i program that? Link to comment Share on other sites More sharing options...
Umz Posted April 28, 2017 Share Posted April 28, 2017 There's the proper way of getting the tile ID etc. Haven't done it, but I searched for it when I had this issue. Then there's the lazy way of making another layer specifically with the water tiles, that solves the different collision responses faster and easier. Link to comment Share on other sites More sharing options...
pdiddles03 Posted April 28, 2017 Author Share Posted April 28, 2017 I know how to get the different tile ID when colliding, but all that happens when colliding with tile is the velocity stops Link to comment Share on other sites More sharing options...
samme Posted April 29, 2017 Share Posted April 29, 2017 There are two approaches: Use Tilemap#setTileIndexCallback Call arcade.collide Return false from the callback that you set in (1) or Call arcade.overlap with a collisionCallback and processCallback Filter the tiles with processCallback Do something in the collisionCallback Link to comment Share on other sites More sharing options...
samme Posted April 29, 2017 Share Posted April 29, 2017 You can see the first approach in examples/v2/tilemaps/tile-callbacks Link to comment Share on other sites More sharing options...
Recommended Posts