I would like to create a tile that can be triggered when the player steps on it in order to affect other desired tiles. pretty much like a pressure tile.
i've tried to make this tile an item tile, then write my code in "on collect do" but it doesn't return to normal when the player isn't on it anymore. ( or i don't know how to properly do it )
In PLAYER script, i made a "playerUpdated" signal
on update do PC_X = event.px // Store starting position PC_Y = event.py emit "playerUpdated" end
In ITEM script i compared the tile current position with updated player's position
on playerUpdated do TX = event.x TY = event.y if TX==event.px then if TY==event.py then isTriggered = "true" else isTriggered = "false" end end end
but once I test it, it seems to have kind of a lagging issue.. especially when the player enters by the X axis.
any ideas ?