1.10.07 - Circle movement

A circle movement makes a circular trajectory around a center point or a map entity.

Methods inherited from movement

Circle movements are particular movement objects. Therefore, they inherit all methods from the type movement.

See Methods of all movement types to know these methods.

Methods of the type circle movement

The following methods are specific to circle movements.

circle_movement:set_center(x, y), circle_movement:set_center(entity, [dx, dy])

Sets the center of this movement as a fixed point or a map entity.

To make circles around a fixed point:

To make circles around a map entity (only during a game):

circle_movement:get_radius()

Returns the radius of circles to make.

If circle_movement:get_radius_speed() is not 0, radius changes are made gradually.

circle_movement:set_radius(radius)

Sets the radius of circles to make.

If circle_movement:get_radius_speed() is not 0, the radius will be updated gradually.

circle_movement:get_radius_speed()

Returns the speed of radius changes.

circle_movement:set_radius_speed(radius_speed)

Sets the radius to be updated immediately of gradually (at the specified speed) towards its wanted value.

circle_movement:is_clockwise()

Returns whether circles are made clockwise or counter-clockwise.

circle_movement:set_clockwise([clockwise])

Sets whether circles are made clockwise or counter-clockwise.

circle_movement:get_initial_angle()

Returns the angle from where the first circle starts.

circle_movement:set_initial_angle(initial_angle)

Sets the angle from where the first circle should start.

circle_movement:get_angle_speed()

Returns the speed of the angle variation.

circle_movement:set_angle_speed(angle_speed)

Sets the speed of the angle variation.

circle_movement:get_max_rotations()

Returns the maximum number of rotations of this movement.

When this number of rotations is reached, the movement stops.

circle_movement:set_max_rotations(max_rotations)

Sets the maximum number of rotations of this movement.

When this number of rotations is reached, the movement stops.

Remarks
The movement stops itself by setting its radius to 0. Therefore, if the radius is set to change gradually (see circle_movement:get_radius_speed()), the movement will continue for a while until the radius reaches 0.
When the movement has stopped, it restarts later if it was set to loop (see circle_movement:get_loop_delay()), and again, possibly gradually.

circle_movement:get_duration()

Returns the maximum duration of this movement.

When this delay is reached, the movement stops.

circle_movement:set_duration(duration)

Sets the maximum duration of this movement.

When this delay is reached, the movement stops.

Remarks
The movement is stopped by automatically setting its radius to 0. Therefore, if the radius is set to change gradually (see circle_movement:get_radius_speed()), the movement will continue for a while until the radius reaches 0.
When the movement has stopped, it will then restart if it was set to loop (see circle_movement:set_loop_delay()), and again, possibly gradually.

circle_movement:get_loop_delay()

Returns the delay after which this movement restarts.

circle_movement:set_loop_delay(loop_delay)

Sets the delay after which this movement restarts.

Remarks
This delay is applied if the movement get stopped by reaching the maximum number of rotations or the maximum duration.
When the movement restarts, the radius starts from 0 and gets back to its previous value, possibly gradually (see circle_movement:set_radius_speed()).

Events inherited from movement

Circle movements are particular movement objects. Therefore, they inherit all events from the type movement.

See Events of all movement types to know these events.