#How would you architect something like a todo list in Bevy?

3 messages · Page 1 of 1 (latest)

royal parrot
#

I'm working on a list similar to a very basic unordered todo list in a game and stumble on how to actually implement it...

Would you suggest having a resource with a Vec<TodoItem> and checking that for changes and re-render the whole list in the UI?

Or would you spawn severalTodoItem components with just data and check when those are added or removed to/from the world, and then as a consequence add or remove individual UI nodes representing each todo item?

I guess another way of putting it: Should the game world mainly contain visual entities or is the world also suitable to be use as a data storage with individual pieces of data as entities, which are separate from the the visuals? Hope the question makes sense.

oak rampart
#

The world can be used to store data with no visuals or no transformations. I have used it like that and I prefer it to a resource because what you said: the ECS features like on added, on removed etc

#

In fact, if I’m not mistaken, the world is already used like that inside of Bevy. I think that systems and schedules are already entities (the initiative was called “systems as entities”) and there are plans to do the same with other things, like Assets