About safeDelete() question
by Apppothk · in iTorque 2D · 10/29/2010 (3:21 am) · 4 replies
i am writting a match3 game like Bejeweled
now i have a little problem with safeDelete()
it still echo the color.
But i set schedule about 300 milsecond. it will echo nothing.
i would like to make a function , it will run after the safeDelete() finish.
how to do that? i wish not use schedule function:)
now i have a little problem with safeDelete()
for(%i=0;%i<$board.xCount;%i++)
{
for(%j=0;%j<$board.yCount;%j++)
{
if( $board.pieces[%i,%j].match$=true){
$board.pieces[%i,%j].safeDelete();
//$board.pieces[%i,%j].visible=false;
}
}
}
for(%i=0;%i<$board.xCount;%i++)
{
for(%j=0;%j<$board.yCount;%j++)
{
if( $board.pieces[%i,%j].match$=true){
echo($board.pieces[%i,%j].gcolor);
}
}
}it still echo the color.
But i set schedule about 300 milsecond. it will echo nothing.
i would like to make a function , it will run after the safeDelete() finish.
how to do that? i wish not use schedule function:)
About the author
#2
10/29/2010 (7:34 am)
I believe there is a callback after delete has completed. You could hook off that?
#3
10/29/2010 (8:44 am)
Alternatively, try to schedule (I know you said you didn't want to...) with a time interval of 0. It'll occur the next game loop. (Safe delete puts things in a list ready for deletion upon the next game loop iteration ya see)
Apppothk
Default Studio Name