derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
734 stars 35 forks source link

add "step" method as an alternative to state_processing and state_physics_processing #37

Closed uzkbwza closed 11 months ago

uzkbwza commented 11 months ago

In many games (such as turn-based games or those with a completely fixed timestep), it does not make sense to use either _processing() nor _physics_processing() to house game logic. This PR allows the user to easily implement their own logic for updating states decoupled from the built-in callbacks.

derkork commented 11 months ago

This sounds pretty useful, thanks a lot for submitting it!

Nrosa01 commented 11 months ago

How do you config the step here? How would you use this in turn based games? I'm not building a turn based game now but I'm highly interested about how you'd use state charts with custom step for that kind of games

derkork commented 11 months ago

I have added a small demo showing this stepping mode and I have added some info to the documentation. Rebased & merged. Thanks a lot for submitting this!