Consider `system` feature
yohamta opened this issue · comments
Yota Hamada commented
The system as a "foreach-system" function feature in Bevy looks interesting.
I am wondering if there's way to achieve the same in donburi using Generics.
This way the user doesn't have to get components directly using query.EachEntity()
but it will be suppilied to the system function automatically, which is nice.
Yota Hamada commented
One idea:
func collisionSystem(query1, query2 *donburi.Query) {
// ...
}
world.AddSystem(query1, query2, collisionSystem)
Yota Hamada commented
Draw system:
func playerDrawer(screen *ebiten.Image, query *donburi.Query) {
// ...
}
world.AddDrawerSystem(query, playerDrawer)
world.Draw(screen)
Yota Hamada commented
Implemented as ECS package