Using t2dSceneObjectSet
by Backman · in Torque Game Builder · 06/14/2007 (1:01 am) · 5 replies
I'm trying to make a puzzle game and need 2-6 pieces stick together while falling down tetris-style. When they land they should break up into seperate pieces.
I'm assuming t2dSceneObjectSet would handle this quite well but struggling to find any documentation regarding it.
Does anyone know where I can find some info about how to use this..? Or a better way to do it.. :) ?
Thanks.
I'm assuming t2dSceneObjectSet would handle this quite well but struggling to find any documentation regarding it.
Does anyone know where I can find some info about how to use this..? Or a better way to do it.. :) ?
Thanks.
#2
Scene object groups/sets sounds like a great feature tho, would love to see it fully implemented in the next version. :)
06/14/2007 (4:28 pm)
Ok thanks, the shapes the blocks make up will probably not be all square so guess I'll have to look at all individual collisions.. but should work.Scene object groups/sets sounds like a great feature tho, would love to see it fully implemented in the next version. :)
#3
Good luck on your puzzle game. Don't forget to post in Show Off! when you've got some shiny screenshots to share. :)
06/14/2007 (10:59 pm)
I agree. There are a few things that they tend to help a lot with, but everything I've used them for I've found better ways to do (Parallax of objects, for example, is *much* easier with multiple scene windows, etc). I expect that's why they were neglected. I doubt they'll be done in 1.5 (since that's supposed to go out very soon), but they might be finished at some point after. I'm not directly working on T2D, so I couldn't tell you for sure. Good luck on your puzzle game. Don't forget to post in Show Off! when you've got some shiny screenshots to share. :)
#4
Anyway, going to try sticking these blocks together here now and we'll see what I can come up with.. :)
06/17/2007 (4:07 am)
Hehe.. thanks will do. Not so shiny yet but hopefully will be soon. One of the reasons I'd like to see scene objects sets is that they seem to be able to let you move a mounted object, something that you can't (?) do just now. Might be a way but haven't figured it out..Anyway, going to try sticking these blocks together here now and we'll see what I can come up with.. :)
#5
06/19/2007 (4:15 pm)
You can move a mounted object by using SetLinkPoint on the mounted parent, although you'd need to write your own version of moveTo for smooth movement.function t2dSceneObject::getParentLinkpoint(%this)
{
%parent = %this.getMountedParent();
if(%parent == 0)
return 0;
%nPoints = getWordCount(%parent.LinkPoints) / 2;
for(%i=0; %i<%nPoints; %i++)
{
if(getWords(%parent.LinkPoints,%i*2,%i*2+1) $= %this.MountOffset)
return (%i+1);
}
return 0;
}
function t2dSceneObject::setPositionMounted(%this, %px, %py)
{
%parent = %this.getMountedParent();
if(%parent == 0)
return;
if(%this.parentLinkPoint $= "")
%this.parentLinkPoint = %this.getParentLinkpoint();
if(%this.parentLinkPoint == 0)
return;
%parent.setLinkPoint(%this.parentLinkPoint, %px, %py);
}
Torque Owner Thomas Buscaglia