Jump to content

Having issues with a hard-restart of my game


JakeCake
 Share

Recommended Posts

I am letting users select settings such as antialiasing on / off, canvas / webgl mode, and texture & physics-polygon resolution. To make these kick in, I am saving the desired settings to localStorage (done) and restarting the game via this function.

function restartGame() {    // Destroy the current game entity    game.destroy();        // Boot a new game entity    main();   }

main() sets up the states again in a new game object and launches boot that launches preload and so on.

 

This all works fine, but for one problem, when I switch from canvas to webgl renderer mode I get some screen artifacts (white quad in the bottom-right) and the screen freezes, no javascript error though.

 

EDIT: The problem doesn't seem to happen when going from canvas -> webgl, but also when going from canvas -> canvas. So it probably has something to do with destroying a game using a canvas renderer.

 

Is there a more built-in way of restarting the game, or is it possible to change renderer & antialiasing on / off without restarting?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...