gdquest-demos / godot-platformer-2d

2d Metroidvania-inspired game for the 2019 GDquest Godot Kickstarter course project.
MIT License
623 stars 74 forks source link

Replace get_parent() calls with _parent var #157

Closed razcore-rad closed 5 years ago

razcore-rad commented 5 years ago

Instead of calling get_parent(), we replace it with a generic _parent "private" var which is initialized in all State-extending classes inside _ready after yield(owner, "ready"). This way it gets initialized automatically and available in all inheriting classes.

NathanLovato commented 5 years ago

Thanks 🙂