turtle_move: Move the Turtle Forward or Backward

Description Usage Arguments Details See Also Examples

Description

turtle_forward moves the Turtle in forward direction and turtle_backward moves the Turtle back.

Usage

1
2
3
4
5
turtle_move(distance, direction = c("forward", "backward"))

turtle_forward(distance)

turtle_backward(distance)

Arguments

distance

single numeric value; specifies the distance to make. Negative distance results in moving in the opposite direction.

direction

character string; moving direction. One of "forward" or "backward".

Details

The Turtle must be initialized prior to using these functions, see turtle_init.

These functions make use of the Turtle's display options specified by the turtle_param function (or if not, use the default options set by turtle_init).

Note that if turtle_up or turtle_down was called, the Turtle's trace will be or not be drawn, respectively.

If you are willing to call these functions in an R loop, you may want to hide the Turtle temporarily (see turtle_hide and turtle_do) before making actual moves. This will increase the drawing performance significantly.

See Also

Other TurtleGraphics: TurtleGraphics-package, turtle_do, turtle_getpos, turtle_goto, turtle_init, turtle_param, turtle_reset, turtle_show, turtle_status, turtle_turn, turtle_up

Examples

1
2
3
4
5
6
7
8

TurtleGraphics documentation built on May 2, 2019, 1:07 p.m.