|Topic was automatically imported from the old Question2Answer platform.
I am creating a game and am having trouble understanding what the best approach is in Godot for coding in player actions. The scenario is a player clicking on a tile in a 3D isometric game which will trigger them to move to the tile then play out an action on it (cut down tree, mine a rock, etc), and then once done receive xp/items for doing it.
So as a series of steps:
- Player input
- (optional) path find and move character
- do player action (an animation)
- show progress bar
- check xp gain
- check item gain
- show xp pop-up
- show item pop-up
- (optional) if levelled up then show level up dialog
- (optional) if finished activity show quest dialog
If done all as event signals that is a lot, and a lot of data to pass through everything to make sure they all know what to do. Normally if coding in another language this would be coded with callbacks, or a top level state machine.
So how have other people approached this, do I just go with events, or add in some callbacks or is there a different way I haven’t thought of?