A way to check if the player is playing in the browser/on the web

A feature that would help quite a bit is a condition to check if the player is playing on a browser.

My problem is that my game is both downloadable and playable online/In the browser and for the downloadable version there should be a quit game button, but for the web version there is no need, so players could get confused on why its there. This condition could also help with other things that you would want exclusive to the web version of your game like graphics settings being lower on the web versions by default to improve performance.

I’m not sure this is possible, because all GDevelop games are “in browser”. Electron is a wrapper for games to make exe/apks/etc, and it is a light version of Chromium.

1 Like

Your requested feature may not happen. So before exporting, can you have two different versions? The exit game button is in your exe download version but not in your uploaded play in browser version.

Yeah I knew I could do this but I was just wondering if there was a less tedious way.

record the lowest fps while player is playing and send it as points in a (hidden) leaderboard

I know this is an old question, but I’ll post my method here for people arriving here from a search engine.

A simple and effective way to manage a web version and a desktop version without having to maintain two (or more) different versions of your game is to use a global boolean variable (something like “isDesktopVersion”). Then in the global variables editor, simply set it to True before building for desktop, or False before building for the web.

In your game code, only display the quit button if isDesktopVersion is True.

Since then, there are Conditions “Is Native Desktop App”, “Is Native Mobile App” for that kind of case.

1 Like