Can you suggest object oriented GDScript tutorial

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ziya

I am starting to have more scripts in my project which I want to organize a bit better. Currently, I am relying on a global script to share functionality but that is getting a bit cumbersome.

I have seen loading or preloading scripts from other scripts and use of classes in a few projects (also trying to use GUT unit testing framework too) but I am having problems understanding the lifetime of the object created, how they are created, e.g. using load or preload and so on.

So my question is that does anyone know of a good tutorial of reusing code, object orientation, or just good practices of managing large-ish GDScript codebases in a project?

Have you considered using reusable scripts that you can attach to multiple nodes?

I don’t have a great in depth example, but I remember seeing it come by in a tutorial I watched a while back… Link below:

Somewhere in that series he also talks briefly about inheritance, I think it was this video but I can’t find it at the moment as I am short on time posting this.

Hope this helped at least a little bit.

Arandual | 2020-07-03 21:34