allegroflare / allegro_flare

Application toolkit for Allegro 5
https://clubcatt.com/allegroflare
MIT License
36 stars 6 forks source link

Add Managed Pause #262

Closed MarkOates closed 7 months ago

MarkOates commented 7 months ago

This PR introduces some changes to improve in-gameplay pause availability. Basically, in-gameplay pausing is ambiguous in design across different projects but should be available, universal, and configurable. It should also be a feature available out-of-the-box.

Things changed:

Some unrelated side enhancements:

Here's a draft sketch of a flow, showing three possible ways that a pause state might be handled by the developer. The Screens/Gameplay emits an event to pause the game (this event could be emitted from anywhere, including a display-switch-out event). The draft is incorrect here showing Screens/Gameplay consuming an event, which it does not. Instead, the Routers/Standard consumes the event and translates it to suspend/unsuspend commands to the Screens/Gameplay.

The actual consequential behavior that happens in the router as a result of consuming the event still remains to be added, though it should be a branched option for the developer. Any of these three options:

1) Activate a Screens/PauseScreen (this should be default behavior) 2) Have the Screens/Gameplay manage everything during pause including a pause menu. (more work for developer) 3) Activate a SubScreen (like zelda) (best experience)

pause-possibilities drawio