PickArea()
by Jeremy Tilton · in Torque Game Builder · 03/16/2005 (8:24 pm) · 2 replies
Ok, so for my tetris game, I have gotten to the point to where I declare "Game Over". I splash a game over image up, but now I want to delete all of the objects. Based on my implementaion, I no longer have a variable name to reference all these blocks by, so I figured I'd use pickArea() and delete everything found on the list:
Problem is the following error:
fxSceneGraph2D::pickArea - Invalid number of parameters!
I didn't really want to specify layers/groups, but if I just did this:
ARGH!
Thank you Jeremy! Why, you are very welcome Jeremy!
%pickList=t2dSceneGraph.pickArea("-20 -50 20 36", BIT(1)|BIT(2),BIT(1)|BIT(2),false);
%objCount = getWordCount( %pickList );
if ( %objCount > 0 )
{
for ( %n = 0; %n < %objCount; %n++ )
{
%obj = getWord( %pickList, %n );
%obj.safeDelete();
}
}Problem is the following error:
fxSceneGraph2D::pickArea - Invalid number of parameters!
I didn't really want to specify layers/groups, but if I just did this:
%pickList=t2dSceneGraph.pickArea("-20 -50 20 36");I still get the same error.ARGH!
%pickList=t2dSceneGraph.pickArea("-20 -50", "20 36");That works..Thank you Jeremy! Why, you are very welcome Jeremy!
About the author
#2
When you are ready, iterate the list and "safeDelete()" the whole lot.
- Melv.
03/17/2005 (12:16 am)
As well as Matts suggestion, you can also add stuff to a "SimSet" to keep tabs on your objects, that's what they're typically used for.When you are ready, iterate the list and "safeDelete()" the whole lot.
- Melv.
Torque Owner Matt Edwards
to delete everything in the scene graph before putting up the game over image.