BlueGit

timfa frameworkv3

game.destroy(), stops game and deletes canvas and such

timfa Tim Falken · pushed by timfa

Authored 2019-10-01 · 7 years ago

Hash
20e6b04fa2123b319dc6eabc2a5169da80af969c
Parent
c040fa2b
1 file changed +8 −0
framework/engine.js +8 −0
@@ -31,6 +31,14 @@ var Game =
31 31 window.setInterval(Game.gameStep, 1000 / fps);
32 32 loadedCallback();
33 33 },
34
35 destroy: function()
36 {
37 Game.activeScene.destroy();
38 window.clearInterval(Game.windowIntervalId);
39 document.getElementById(GameWindow.elementID).outerHTML = "";
40 document.getElementById("g_gameTextInput").outerHTML = "";
41 },
34 42
35 43 loadScene: function(newScene, destroyOld = false)
36 44 {
@@ -31,6 +31,14 @@ var Game =
31 window.setInterval(Game.gameStep, 1000 / fps);
31 window.setInterval(Game.gameStep, 1000 / fps);
32 loadedCallback();
32 loadedCallback();
33 },
33 },
34
35 destroy: function()
36 {
37 Game.activeScene.destroy();
38 window.clearInterval(Game.windowIntervalId);
39 document.getElementById(GameWindow.elementID).outerHTML = "";
40 document.getElementById("g_gameTextInput").outerHTML = "";
41 },
34
42
35 loadScene: function(newScene, destroyOld = false)
43 loadScene: function(newScene, destroyOld = false)
36 {
44 {