SetNextAnimatedTile
From Spheriki
Sets the next tile index of an animation sequence, given the preceding tile.
Contents |
Usage
- tile Number, non-negative. Index of the tile to modify the animation chain at.
- next_tile Number, non-negative. Index of the new tile of the animation.
Examples
Say the current map contains an animation of 1 > 2 > 3 > 1 > ... and we want to set the animation to 1 > 2 > 1 > ... instead. This can be done by setting tile 2's next animated tile to 1 instead of 3.
SetNextAnimatedTile(2, 1);
And if we want to make it such that tile 3 no longer goes to 1:
SetNextAnimatedTile(3, 3);
Which will disable animation in tile index 3 (the fourth tile.)
Notes
- As shown in the example, animation can be disabled for a tile by pointing the next animated tile to itself.
- Tile animations are formed by daisy-chaining tiles, linking them by setting the next tile in the animation sequence, along with a delay. This function lets you change this while your game is running.
- Use GetNextAnimatedTile() to find out how animation chains are laid out at runtime.