Hacker News new | ask | show | jobs
by skratlo 1763 days ago
Why does it follow this pattern, at least in the docs, where the user is supposed to subclass Scene and provide a construct method? How does inheritance help here? Wouldn't it be simpler if instead users can make Scene using their own abstractions and functions in whatever way they feel is appropriate?
2 comments

I assume the Scene class is called into from some other part of the engine. So, your code needs to at least enter via those functions and return the right value / have the required side effects.

There are probably other methods defining the scene interface defined in the base class definition.

That's how OOP (but not Python) is taught sometimes