Rendering help

Hello everyone…

back here with a new problem…i am creating a game here with 14x14 grid, i have to change the color of cloned game objects according to my input…
i have done that.my code is working fine,but here is lot of rendering problem with my code,
do you guys any idea why this happening to me with the below given code…

function process_Color(c : int, obj : int)
{
prev_Mat = swap_Mat;
x = obj;
try{
if(square[x-14].renderer.material.color == curr_Mat.color || square[x-14].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x-14);
}
}catch (e){}

try{
if(square[x-1].renderer.material.color == curr_Mat.color || square[x-1].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x-1);
}
}catch (e){}

try{
if(square[x+1].renderer.material.color == curr_Mat.color || square[x+1].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x+1);
}
}catch (e){}

try{
if(square[x+14].renderer.material.color == curr_Mat.color || square[x+14].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x+14);
}
}catch (e){}
}

sorry for not tagging,i don’t know how to do tagging.
and thanks for the help.

In the advanced mode there is button to put things in code tags (looks like a ‘#’, next to quote), highlight the code block you want put into the code tags and push the button.

In the quick reply box there isn’t a button so you have to manually type in [code ] [/code ] (without the spaces between ‘code’ and ‘]’) before and after the text you want in the code tags.

… not sure what you’re asking. Are you getting errors? or is it not doing what you want it to? (if so we need to know what you are seeing it do, and what you want to see it do)

hello,

thanks for the help.man my code is working, but it gives me a random kind of behavior…
some times it works fine up-to 3-4 tunes(i.e execution of whole code) but some time it does not provide me the exact output that i want…

you can download my project from here for better understanding my problem:

1208719–48968–$Color Fill.zip (1.72 MB)