How do I refresh tile collisions? [Solved]

Valinor Games

  • Posts: 55
I am making a bomberman style game where you place bombs that destroy blocks after a set amount of time. But, when you use tile API to destroy tiles, the collision shapes for the map don't refresh, and you cannot walk through the hole you just made.

Does anyone know how to refresh the collision shapes  for the map?

Thank you

« Last Edit: July 27, 2016, 06:03:39 am by Valinor Games »

Hectate

  • *
  • Posts: 4645
As stated in the Stencylpedia article for the Tile API "Remove Tile At" block:
Quote
Remove Tile At Row: (number) Col: (number) LayerID: (number)

Type: Action

This block will delete the tile at the given coordinate and layer. Note that deleting a tile will only remove it's collision shape from the scene if it was added through the Tile API. If the tile was placed in Scene Designer, the tile's visual image will be removed but the collision shape will remain behind (invisible unless Debug Drawing is enabled).

Because tile's collision shapes are combined before the game is compiled, you cannot modify that collision shape by adding and removing tiles. If you add the tiles using the Tile API, however, you would be fine.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Valinor Games

  • Posts: 55