Godot script

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

can someone give me a quick overview on how godot script work like
-why is there an extend at the top of the script and
-if there is an extend shouldn’t the code be all inherited classes instead of predefined functions?

:bust_in_silhouette: Reply From: kidscancode

A GDScript file is a class. The extends line identifies what base class the script is extending.

I’m not sure what your second question means at all.

You can start learning about GDScript here: https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html#introduction

first of all iam glad you responded and my second questions meant if GDScript is a class why isn’t the whole code extends from it we will write class ready instead of function ready

payload505 | 2020-03-17 04:00

The question still doesn’t make sense. func defines function (also called a method) belonging to the class. Writing class would define a new class.

It seems that you may not understand how object oriented programming works. Here are a few links that may help:

Beginner's guide - Object Oriented Programming - DEV Community

Since Godot is strongly object-oriented, it’s important to understand OOP, as well as other basic programming concepts.

kidscancode | 2020-03-17 04:10

Thanks for the answer of payload505. Have some question

eramusic | 2020-03-17 16:11