I was playing with ThreeJS to make a tiny game prototype and I didn’t know how to change a ThreeJS scene in order to restart the level, change it or load a game.
It’s not so hard but you should know a few points.
As you know, ThreeJS links a scene to a DOM element and you can have only 1 scene.
Probably you would have it with a UI, for example:
<div id="game"> <span id="health" style="position: absolute; top: 5%; left: 5%;"> </span> </div>
And your scene uses it as container.
Ok, we can have only 1 scene and we already have the UI in the container. Continue reading How to change a ThreeJS scene