ppb / pursuedpybear

A python game engine.
https://ppb.dev/
Artistic License 2.0
258 stars 98 forks source link

More aggressive walk function #665

Open pathunstrom opened 2 years ago

pathunstrom commented 2 years ago

The current walk is fine as is, but we need a walk implementation that doesn't care if the child has its own walk method so that the renderer itself can be sure to reach all renderable objects.

We can call the new method render_walk for now (unless someone has a better idea) and it should only care that each level has children. It can use the render_walk method to get the child and grandchildren, but has to work with the case that render_walk isn't implemented.

Part of supporting #577

AstraLuma commented 2 years ago

Current function is already pretty aggressive and has minimal dependencies on object methods? What it doesn't do is allow you to prune the walk.

pathunstrom commented 2 years ago

It still relies on walk doing the right thing. If we want to support "renderer always gets everything" and "can opt out of event dispatch" we need to split this regardless.

AstraLuma commented 2 years ago

true, but we have so little design on "can opt out of event dispatch", i wouldn't worry about it.

pathunstrom commented 2 years ago

Then how about we change the scope of this to having the current walk step around game objects that don't implement walk?