I still don't get it.
But I've got something working.
The script attached to a Node2D:
extends Node2D
var ab = Motorcycle.new()
func _ready() -> void:
print(ab.speed)
and in an other script , somewhere in the res:// folder:
class_name Motorcycle
var speed = 0
It prints the speed.
And when I use yet an other script:
extends Motorcycle
class_name Car
var test:Motorcycle
I am allowed to reference 'Motorcycle' in a variable.
And closing does not give an error.
Strange, because the 'car' is an extended 'Motorcycle'
Perhaps someone can explain this, because I would like to understand.
edit:I really shouldn't answer my own questions. (And this was the second one!)