Game Development Community

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? ;)

#1
10/22/2005 (3:15 am)
Check out example/T2D/client/client.cs

// --------------------------------------------------------------------
// Destroy Client.
//
// Here we destroy the SceneGraph.
// --------------------------------------------------------------------
function destroyClient()
{
	// Destroy fxSceneGraph2D.
	if ( isObject(t2dSceneGraph) )
		t2dSceneGraph.delete();	
}

--
Hans
#2
10/22/2005 (1:00 pm)
Thanks for helping out, everything works great now!