kittykatattack / hexi

Make games the fun way!
MIT License
551 stars 83 forks source link

Destroy or reinitialize the Game #53

Closed thomasverleye closed 2 years ago

thomasverleye commented 6 years ago

Hi,

I have a major performance issue with a game i'm creating. It's a game with multiple levels which are build in Tiled. It's a Vue JS website, each time I open a level I need to reinitialise Hexi with a new .json file and spritesheets. Is there in any way a possibility in Hexi to stop the processes in the background (destroy the current game) and start over?

Because after opening and restarting multiple levels my players starts walking very slow. I first thought it was because of the loop that's been called multiple times or maybe I had to work with requestAnimationFrame but these things had no difference whatsoever.

I'm out of options, my last option is to take away the VUE functionality and reload the page each time a player opens up a level, but this will have to reload a lot more assets and files. Which I obviously rather not do.

Kind regards,

Thomas

kittykatattack commented 6 years ago

Thanks for posting this! Unfortunately as I am not a Vue user I don't know how to help with this problem. Can anyone out there please assist us??