Program design issues
by bentgarney · in Torque Game Builder · 03/02/2005 (11:43 am) · 2 replies
#2
%obj2 = newScriptObject()
{
color = blue;
}
%obj = newScriptObject()
{
color = red;
neighbor1 = %obj2;
}
%obj.neighbor1.color
You probably wouldn't want to use Neighbor1... probably a local co-ordinate (guessing the balls will form a hex pattern) to the neighbor?
oo
ooo
oo
03/02/2005 (12:46 pm)
Hmm.. I'd think you could use scriptObjects to define the ball, and keep a linked list of neighbor objects, then on before you delete it check each neigbors color.%obj2 = newScriptObject()
{
color = blue;
}
%obj = newScriptObject()
{
color = red;
neighbor1 = %obj2;
}
%obj.neighbor1.color
You probably wouldn't want to use Neighbor1... probably a local co-ordinate (guessing the balls will form a hex pattern) to the neighbor?
oo
ooo
oo
Torque Owner Philip Mansfield
Default Studio Name
If a red ball is next to another red ball, create a mount point and join the two together. You could then destroy all the balls in one go by destroying the parent ball (the very first ball that has a mount object).
I might be off the mark here, but I'm sure someone else will be along to offer a more sensible solution ;)