how to best link a class to a behavior action
by rennie moffat · in Torque Game Builder · 02/10/2010 (10:42 am) · 2 replies
How can I best link a class to a behavior?
So say I want a btn (button) to dismount objectA from objectB. However there are lots of object A types, so objectA1, thru objectA12. I figure if I just use a class name so when btn pressed (onMouseUp), this dismounts objectA from objectB. bust since objectA could be objectA1-objectA12, I need my btn to just see the class. This is being done in a behavior.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
02/10/2010 (10:51 am)
where I am most confused is here, as I must find if an object from the class "starsStarClass" is mounted to object Star.if(%this.class $= "starsStarClass")
{
///this is where i am confused as what is %this here?
///I need it to point to any object in this starStar class
///so does this point to the class because of the if statment above?
if(%this.getIsMounted())
{
%this.owner.setUseMouseEvents(true);
}
}
Torque Owner rennie moffat
Renman3000
if (%dstObject.class $= "paddleClass")
where %dstObject could be %this.