Does anyone have any experience running html5 Defold games on a website built using the Angular framework?
Getting games to run and play has been fine so far, I’ve been able to get a Defold game to play by converting the index.html file Defold generates when building a game as html5 to an Angular component and loading in the gamename.wasm + archive files using the provided dmloader.js.
But an issue arises when navigating away from the game. Sound effects and music continue playing and in fact I believe the entire game is actually still running, likely because Angular is a “single page application” web framework which keeps most data ‘alive’ so that it doesn’t need to load it again in the future.
So the real question is, is there a way to unload/stop a html5 Defold game? (without reloading the webpage, something like creating a dmloader function EnginLoader.unload(“game_path”))
I fully understand this is fairly heavy on angular stuff however as Defold provides the dmloader.js file for loading html5 games maybe someone here has some ideas.
[note for anyone else trying the same thing: I have had some success by loading the game in an <iframe>
or navigating to the game using hard <a>
links but both strategies effectively reload the webpage which defeats the purpose of using Angular routing in the first place]