Skip to content

Instantly share code, notes, and snippets.

@tj

tj/gist:78787

Created Mar 13, 2009
Embed
What would you like to do?
# Torque Script
if (!isObject(FollowMouseExBehavior))
{
%template = new BehaviorTemplate(FollowMouseExBehavior);
%template.friendlyName = "Follow Mouse Ex";
%template.behaviorType = "AI";
%template.description = "Set the object to follow the position of the mouse. This version can be " @
"restricted by world limits and will obey collisions.";
%template.addBehaviorField(flipX, "Flip X axis", bool, true);
%template.addBehaviorField(followX, "Follow the mouse's X position", bool, true);
%template.addBehaviorField(followY, "Follow the mouse's Y position", bool, true);
%template.addBehaviorField(trackingSpeed, "The rate at which the object will move toward the mouse", float, 15.0);
}
# Less Lame Torque Script
unless is_object(FollowMouseExBehavior)
:template = new BehaviorTemplate(FollowMouseExBehavior)
:template
.friendly_name = "..."
.behavior_type = "..."
.description = "..."
:template
.add_behavior_field(flip_x, "...", bool, true)
.add_behavior_field(follow_x, "...", bool, true)
.add_behavior_field(follow_x, "...", bool, true)
.add_behavior_field(tracking_speed, "...", float, 15.0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.