Learning OOP

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By barkalot
:warning: Old Version Published before Godot 3 was released.

Hi,

I’m new here and can I say how pleased I am do have found an engine that is under active development. For years I have been trying to learn Python and I thought that the only option was Pygame or Unity. Sadly to use unity i’d have to learn javascript and I really have no interest in that as I love Python. Why learn something that just adds complexity.

So I was delighted to find GDScript is mainly based on Python.

The problem I’m having is I have grasped many of the core concepts of Python but its all functional style. For years I have been trying to get by head found OOP and no matter what I look at I still can’t get it. I feel this is holding my back from moving forward.

So my question is does anyone know of any good OOP tutorials. I know about Simon Allardice’s courses but have not got to buying them yet. As never been a big fan of IDLE so I use a little app called Thonny instead.

Thanks in advance.

As always, things depend on what you’re trying to achieve. If you are into game engines, I would rather focus on understanding how to achieve what you want within the framework of the engine itself. If you over-focus on strict programmatic principles and architecture you will eventually hit walls which I think is unnecessary. You are anyway attaching smaller scripts to various nodes and maybe routing some signals between them.

Personally, I discovered that the language itself is not that important - I was a bit put off by GDScript in the beginning, but in the end it turned out quite OK - it is efficient, it gets thing solved without to much fuss.

For game programming I would rather focus on patterns like the one in this great online free book: Game Programming Patterns

Sorry for not answering the question directly, but I just get the feeling that you’re putting up an unnecessary barrier for yourself if you want to make games :slight_smile:

dj_pale | 2017-03-29 23:05

:bust_in_silhouette: Reply From: Omicron

Try here Object Oriented Programming · HonKit
There some code samples to run and try, to get a hand on OOP.

Or here : 1. Object Oriented Programming | OOP | python-course.eu with some graphics, that help understanding.

You will quick understand that all documented features of Godot are classes/function and objects.

:bust_in_silhouette: Reply From: Anutrix

You can try this book Think Python. Not free but really helped me.