Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | CarlF |
Note: I also asked this question over at the Godot Forums.
I created a scene for my (2D) game which is a subclass of Sprite. Essentially it’s Sprite, with a script added that makes it draggable during play, and emits a signal when it’s being dragged (which is used to update a label that shows range to a stationary object on the map). Another object, basically a graphical menu, allows the player to create an instance of this subclass of Sprite, which can then be dragged to a selected location.
Now, the game should have multiple objects with similar behavior (draggable, range displayed by that same label) but not identical. I’d like to subclass this one and then change the things that should be different by overriding methods and properties of Barricade (the first class). Is there provision in Godot to subclass a user-created subclass of one of the built-in classes? Obviously I could just copy the class and change the properties/methods, but then if I tweak the script it becomes a nightmare to update all the copies.
Thanks.