Sys.exit() freez game on HTML5

clicking the exit button call sys.exit(0).
it works on desktop and android. but on Html5 it freezes the game and does not exit.
I thought it was not that important but my game was rejected by Yandex because of this issue.
you can check it in this repo:

You can use sys.exit() on html5 as well, but it depends on what you expect will happen when you press it? It will not shut down the browser tab/page or anything like that.

2 Likes

so what do sys.exit in Html?
is there any way to close the tab in code by defold-lua?
or it is pointless to put the exit button in HTML games?

HTML5 games shouldn’t have anything like “exit” option. So you can just check

if html5 then
    hide_my_exit_button()
end
5 Likes