GDevelopApp / GDevelop-extensions

Repository of behaviors, actions, conditions and expressions to be used in GDevelop for creating games
https://gdevelop.io
MIT License
127 stars 50 forks source link

New extension: Auto Pauser #1117

Open MTSyntho opened 9 months ago

MTSyntho commented 9 months ago

Description

This new GDevelop Extension will pause your GDevelop game for the player once the window loses its focus from the player. It works by using the condition checking if the window has lost focus, and when its focus has been lost, the Time Scale is set to 0, unfortunately when the game regains focus it sets back to 1, and doesn't support other time scales upon unpausing.

It has one action allowing the game to pause itself when focus is lost, and another action to manually pause and unpause the game.

It has one condition to check if the game is paused, which should allow for actions to be executed, because some objects will not be paused depending on how your code has been written.

It has one expression which returns a 0 or a 1, it depends on if the game is paused or not.

It's a pretty basic extension but I'm sure it might have a use for someone.

How to use the extension

If you use the 'Enable Auto-Pausing' action and set the parameter to 'Yes', it will automatically pause the game for you, however it must be in an condition that doesn't execute once, no condition works too.

Checklist

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

Auto Pauser Extension Example.zip

Extension file

AutoPauser.json

github-actions[bot] commented 9 months ago

šŸ‘‹ Thanks for your submission! We are sorry, but the filename of the extension has unrecognized characters. Since filenames with weird character can cause all kinds of problems and security flaws, our system won't allow file names with other characters than normal latin upper- and lowercase characters or numbers. Additionally, the first character must be an uppercase character. Please update your original submission post with a new zip file containing your extension with another file name following those guidelines šŸ™