move.*
Type : Library
Revision : 2016.0720
Overview
The move library provide method for advaced move.
Functions
move.seek()
move.seek()
Type : Function
Library : Sublevel.*
Return value : Boolean
Revision : 2016.0720
Overview
The seek()
method allow a display object with physics body to seek a target. It's used for create homing objects like homing missiles.
Syntax
move.seek(obj, target, options)
obj (required)
DisplayObject. The seeker with Physics body.
target (required)
DisplayObject The target chased by the seeker.
options (reqired)
See the options below.
Options
maxForce (optional)
Number. The maximum force of steering, and the default value is 50
minForce (optional)
Number. The minimum force of steering, and the default value is 1
magnitude (optional)
Number. If the seeker has zero velocity on both x and y axis at the beginng, the seek method will use magnitude and degree to generate the initial speed of the seeker. The default value is 450.
degree (optional)
Number. As above. The default value is the target dirction (dir) or 0.