Solarus quests
1.6
Quest maker's reference
|
A straight movement follows a rectilinear trajectory. You can define the trajectory as an angle and a speed.
Straight movements are particular movement objects. Therefore, they inherit all methods from the type movement.
See Methods of all movement types to know these methods.
The following methods are specific to straight movements.
Returns the speed of this movement.
Sets the speed of this movement.
speed
(number): The new speed in pixels per second.Returns the angle of the trajectory in radians.
East is 0
, North is math.pi / 2
, West is math.pi
, South is 3 * math.pi / 2
and any intermediate value is possible.
Sets the angle of the trajectory in radians.
East is 0
, North is math.pi / 2
, West is math.pi
, South is 3 * math.pi / 2
and any intermediate value is possible. Negative values and values greater to 2 * math.pi
are also accepted.
angle
(number): The new angle in radians.Returns the maximum distance of this movement.
The movement will stop when this distance is reached.
0
means no limit).Sets the maximum distance of this movement.
The movement will stop when this distance is reached.
max_distance
(number): The maximum distance in pixels (0
means no limit).Returns whether this movement adjusts its trajectory when an obstacle of the map is reached. This property has no effect if the movement is not attached to a map entity or if the movement ignores obstacles.
true
if this movement is smooth.Sets whether this movement should adjust its trajectory when an obstacle of the map is reached. This property has no effect if the movement is not attached to a map entity or if the movement ignores obstacles.
smooth
(boolean, optional): true
to make this movement smooth. No value means true
.Straight movements are particular movement objects. Therefore, they inherit all events from the type movement.
See Events of all movement types to know these events.