Created
March 13, 2009 21:48
-
-
Save tj/78787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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