adrien-bon / bevy_ecs_tiled

Helpers for working with 2D tilemaps created with the Tiled map editor
MIT License
34 stars 8 forks source link

Animated tiles must be adjacent in the tileset #12

Open adrien-bon opened 3 months ago

adrien-bon commented 3 months ago

This limitation comes from bevy_ecs_tilemap.

Right now, we use the bevy_ecs_tilemap::tiles::AnimatedTile struct which is defined as follow:

pub struct AnimatedTile {
    /// The start frame index in the tilemap atlas/array (inclusive).
    pub start: u32,
    /// The end frame index in the tilemap atlas/array (exclusive).
    pub end: u32,
    /// The speed the animation plays back at.
    pub speed: f32,
}

We only get a start and an end indexes which implies tiles are next to each other in the tileset.

Possible work-around: