Best practice for tile map #14134
Unanswered
LuckyTurtleDev
asked this question in
Q&A
Replies: 1 comment
-
If you intresting in productive ways, there are two examples Many Sprites and Many Animated Sprites, which are stress test |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi, I am new to bevy and ecs.
What is the best practice for tile maps?
I can put every tile inside its own component/entity. But for collision this means that I need to iterate over all tiles. Is this a performance issue? Another issue is that I do not know how to perform path-finding, if every tile is a separate entity since I don not know the neighbor tiles.
Another idea would be to create ab big entity which store the single tiles as entity in a Vec2. So I can simple check per index the tile at needed position for collision. Also path finding should now be easy since if exactly now which tile is neighbors of another.
It should also possible to still query the single tiles directly. If I drop/delete the map this should also remove the tiles owned by it from the ecs right?
Beta Was this translation helpful? Give feedback.
All reactions