ppb / pursuedpybear

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

GameObects need to have a parent #666

Open pathunstrom opened 2 years ago

pathunstrom commented 2 years ago

In an effort to support relative positioning inside of #577 we're going to need to break a fundamental assumption of ppb: objects need to know the container they live in. Since we have the gomlib now, we don't need to worry about this.

Add a self._parent as a weak reference to the containing GameObject, then when a GameObject is added to another, set the child._parent to the container. When you remove a GameObject from another, set that reference to None.

AstraLuma commented 2 years ago

I believe @avarice-m said in discord faer would be working on this.

jonesmat commented 6 months ago

@pathunstrom does this still need to be done?