FormularSumo / Galaxy-Collection-Web

Website/Web App version of the game hosted on GitHub Pages
https://formularsumo.github.io/Galaxy-Collection-Web/
GNU Affero General Public License v3.0
2 stars 0 forks source link

OS/Browser can't be detected from Lua/Love2D #5

Open FormularSumo opened 2 weeks ago

FormularSumo commented 2 weeks ago

For a few things, the game needs to behaviour differently depending on the platform. For example, the pause_on_loose focus setting being off doesn't work on mobile very well because Android and iOS are very aggressive in suspending background processes (using the correct platform/web APIs it'd probably be possible to work around this.. but not very feasible to do from the Love2D/Lua environment), so ideally I'd like to remove the toggle so it's always on (like I do on the Android native app). Another example is how scrolling doesn't work consistently across platforms - it's way faster on Linux and ChromeOS. I would like to slow this down, but I can't when OS is always returned as "Web" by Love2D.

There is a bridge you can use to communicate between Love2D and Javascript, however it requires console wrapping to work, which is disabled on Github pages unfortunately.