Gun
by Robert Carroll · in Torque Game Builder · 10/06/2009 (1:25 am) · 0 replies
I have a Platformer that (I hope) will use different guns im tring to make a OnCollitionSwitchBehavior.
==========================================================
Heres the Swap image could anyone pls pls help with this :?
==========================================================
if (!isObject(SwapImageOnCollisionBehavior))
{
%template = new BehaviorTemplate(SwapImageOnCollisionBehavior);
%template.friendlyName = "Swap Image On Collision";
%template.behaviorType = "Effects";
%template.description = "Switches the image of an object when it collides";
%template.addBehaviorField(image, "The image to swap to", object, "", t2dImageMapDatablock);~What Would Be a behavior? like behavior block?
%template.addBehaviorField(frame, "The frame of the image to swap to", int, 0);~Don't need this.
}
function SwapImageOnCollisionBehavior::onBehaviorAdd(%this)
{
%this.owner.collisionCallback = true;
}
function SwapImageOnCollisionBehavior::onCollition(%this, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contacts)~Im not totally sure what this is.
{
if (isObject(%this.image))~Behavior? replaces the image?
%this.owner.setImageMap(%this.image, %this.frame);~Don't think this needs to be included? For a Behavior.
}
==========================================================
Heres the Swap image could anyone pls pls help with this :?
==========================================================
if (!isObject(SwapImageOnCollisionBehavior))
{
%template = new BehaviorTemplate(SwapImageOnCollisionBehavior);
%template.friendlyName = "Swap Image On Collision";
%template.behaviorType = "Effects";
%template.description = "Switches the image of an object when it collides";
%template.addBehaviorField(image, "The image to swap to", object, "", t2dImageMapDatablock);~What Would Be a behavior? like behavior block?
%template.addBehaviorField(frame, "The frame of the image to swap to", int, 0);~Don't need this.
}
function SwapImageOnCollisionBehavior::onBehaviorAdd(%this)
{
%this.owner.collisionCallback = true;
}
function SwapImageOnCollisionBehavior::onCollition(%this, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contacts)~Im not totally sure what this is.
{
if (isObject(%this.image))~Behavior? replaces the image?
%this.owner.setImageMap(%this.image, %this.frame);~Don't think this needs to be included? For a Behavior.
}
About the author
Stay Up all night playing PS3 ;) add me PSN: RCBASEBALL13.