Skip to content

Animated Tile? #298

Answered by Trouv
aoidenpa asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry it took me a while to get back to you on this. I think you can just insert that component on the tile you're interested in, I don't see why not. Though, note that bevy_ecs_tilemap requires that the tiles in the animation be contiguous.

Selecting the appropriate tile entity in a system could be done in a couple different ways depending on your use case.

If there's an intgrid value associated with the tiles you want to animate - you could add the AnimatedTile using the ldtk int cell registration API. Something like...

fn animation_component_for_water_tile(_: IntGridCell) -> AnimatedTile {
    todo!()
}

#[derive(Debug, Default, Bundle, LdtkIntCell)]
struct WaterBundle {
    #[with(ani…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aoidenpa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants