Hello. I'm a newbie in programming and I've been studying inheritance for quite a while. So, in one of my tests, I basically created this script (bellow), and extended it in one of my nodes's script. (without adding anything):
extends Node2D
//Base class
func do()
print("test")
func _ready()
do()
extends "res://script.gd"
//Inheriting class, added nothing to it
After extending it, I noticed that the method was being called twice, thus making two "test" printing on the output. I assume that the base class automatically called the extended method from my node's script, making it print twice.
My questions are:
Is there a way of preventing this? What if I ever wanted only the base class method to be called?
Does other programming languages work in the same way, or is it a gdScripts-only feature?
Thanks in advance!