carenalgas / popochiu

Godot plugin to make point n' click games in a similar way to tools like Adventure Game Studio and Power Quest.
MIT License
154 stars 15 forks source link

Add a way to handle what happens when a character stops moving #240

Open mapedorr opened 1 month ago

mapedorr commented 1 month ago

Benefit description

When the PC (in the future any other character) stops moving, it would be good to have a virtual function so devs can define a custom behavior for that. E.g. Stop a looping walking audio file.

Solution description

Add a _on_move_ended virtual function to PopochiuCharacter. This function will be called by the room when the movement stops either by an interaction of the player (e.g. clicking anywhere in the room) or because the moving character reached its target movement position.

Implications

Scripts that are connected to, or awaiting for, the move_ended signal of the moving character, could trigger unexpected behaviors since they may assume that the signal will only be triggered when the character reaches its target, but not when the target has changed due to player interaction.