Why can I extend a node with a class that does not extend that node type?
Hi, I'll ask the basic question first then try to explain why I am asking it.
Using GDScript - Say I have a KinematicBody2D node, call it "theplayerbody" and a class that extends Node2D, call it "playersclass".
I can attach a script to "theplayerbody" and have it extend "playersclass" even though "playersclass" does not extend KinematicBody2D.
I'd have thought this would throw an error. Is it allowed because they both extend Node2D at some level?
It is rather useful for me as it happens as I wanted to be able to have a base "Entity" class that extends Node2D for pretty much anything in the game that is not background or GUI. The Entity class would have sub classes/nodes that extend it, some of which might move about, like players and MOBs, others might be fixed, like chests or furniture. So the Entity class would have to be able to be extended by different classes of nodes, kinematic, basic node2d etc.
Is this a bad approach or is this entirely as expected?
Any thoughts much appreciated.