We are going to construct our Player object directly in our Database scene.
Go to that scene, bring in an instance of the Thing.tscn we just made. Clear its script, and replace it with a new one at res://things/Player.gd.
This script will begin with extends res://things/Thing.gd. This script will then include all the player-specific functions of a Thing, for now Movement. By extending the base Thing script, our Player script now also has all the functionality of a Thing, without it taking up any extra space in its own script.
This should begin to look a lot like Godot's own node hierarchy, just much more simplified.
We are going to construct our Player object directly in our Database scene.
Go to that scene, bring in an instance of the Thing.tscn we just made. Clear its script, and replace it with a new one at
res://things/Player.gd
.This script will begin with
extends res://things/Thing.gd
. This script will then include all the player-specific functions of a Thing, for now Movement. By extending the base Thing script, our Player script now also has all the functionality of a Thing, without it taking up any extra space in its own script.This should begin to look a lot like Godot's own node hierarchy, just much more simplified.