Hi Community,
Today I found something really interesting about the OOP in the BGE in this thread:
http://www.blendpolis.de/viewtopic.php? ... op#p329403
Perhaps you can't read german and even though you could it's really hard to understand (anyway for me after reading and reading again...).
So I try to summarise:
1. Complex python-structures in blender are only possible with the "Python Module Controller".
2. Because you can't access the KX_GameObject by inheritance you could make your own class "GameObject" and give this constructor the controller of the KX_GameObject.
Than you can instantiate it wherever you want in your code and make the instance of your "GameObject" as Property of your KX_GameObject.
For a concrete example he uploaded a file in this thread:
There his GameObject inherit from an other class that allows to save the object states.
The mainfunction works only for linux because of the paths he used but the structure shows hopefully what he meaned.
Well, why I wrote this to you?
Because I think it's a style that should see the whole blender community, particularly the beginners because this reduces a lot of work quite from the beginning of a project.
Like in my case; Now I would like to rewrite all my BGE-code because this architecture is much cleaner.
With kind regards,
dwb
