Unloading scene?
by Denis Linardic · in Torque Game Builder · 10/21/2005 (3:58 pm) · 2 replies
Hi guys! Could you give me few pointers on how to unload scene (as clean as possible without exiting T2D of course ;) ).
I am trying to create level 2 in space scroller demo and this is how it's working so far:
When player reach score of 30000 script level2.cs i called and fxImageMapDatablock2D load new background objects. Load goes well, and after that I am trying to reload scene but I get old scene loaded over the existing one so I guess that I have to shutdown current scene and safedelete all datablocks, and then load level2.cs and load scene again.
Basicly the question is how to kill the current scene? ;)
I am trying to create level 2 in space scroller demo and this is how it's working so far:
When player reach score of 30000 script level2.cs i called and fxImageMapDatablock2D load new background objects. Load goes well, and after that I am trying to reload scene but I get old scene loaded over the existing one so I guess that I have to shutdown current scene and safedelete all datablocks, and then load level2.cs and load scene again.
Basicly the question is how to kill the current scene? ;)
About the author
Torque Owner Hans Sjunnesson
// -------------------------------------------------------------------- // Destroy Client. // // Here we destroy the SceneGraph. // -------------------------------------------------------------------- function destroyClient() { // Destroy fxSceneGraph2D. if ( isObject(t2dSceneGraph) ) t2dSceneGraph.delete(); }--
Hans