YeOldeDM / lets-godot-roguelike

A tutorials series on how to build a simple roguelike in the Godot Game Engine
MIT License
24 stars 5 forks source link

`Player` scene #34

Open YeOldeDM opened 7 years ago

YeOldeDM commented 7 years ago

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.