Hey Guys, I'm trying to set up a background effect with a tilemap but i cant seem to figure it out,
I basically just want that when the mouse hovers over the tiles, the tiles would change to the second tile, then when the mouse is not over them, there will be a short delay before they change back to the first tile.
the way i set it up is almost right except the tiles change back all at the same time instead of one at a time.
any advice would really be appreciated, i've been trying to figure it out for a while.
Here is my current code:
// Spawn Initial Tiles
+ System: On start of layout
-> System: Set layout scale to 2
----+ System: For "X" from 0 to 216
--------+ System: For "Y" from 0 to 192
---------> Tilemap: Set tile (LoopIndex("X"), LoopIndex("Y")) to tile floor(random(2))-1 (normal)
// Cell State Management
+ Mouse: On movement
-> (no actions)
+ Tilemap: Tile (Tilemap.PositionToTileX(Mouse.X), Tilemap.PositionToTileY(Mouse.Y)) = 0
-> Tilemap: Set tiles at (Tilemap.PositionToTileX(Mouse.X), Tilemap.PositionToTileY(Mouse.Y)) with area 1 x 1 to tile 1 (normal)
// Revert Tiles Back to 0
+ System: Every 0.55 seconds
----+ System: For "X" from 0 to 216
--------+ System: For "Y" from 0 to 192
--------+ Tilemap: Tile (LoopIndex("X"), LoopIndex("Y")) ≥ 1
---------> Tilemap: Set tiles at (LoopIndex("X"), LoopIndex("Y")) with area 1 x 1 to tile 0 (normal)