Microsoft Small Basic


Turtle

The Turtle provides Logo-like functionality to draw shapes by manipulating the properties of a pen and drawing primitives.

Properties

Speed

Turtle.Speed

Specifies how fast the turtle should move. Valid values are 1 to 10. If Speed is set to 10, the turtle moves and rotates instantly.

Angle

Turtle.Angle

Gets or sets the current angle of the turtle. While setting, this will turn the turtle instantly to the new angle.

X

Turtle.X

Gets or sets the X location of the Turtle. While setting, this will move the turtle instantly to the new location.

Y

Turtle.Y

Gets or sets the Y location of the Turtle. While setting, this will move the turtle instantly to the new location.

Operations

Show

Turtle.Show()

Shows the Turtle to enable interactions with it.

Returns

Nothing

Hide

Turtle.Hide()

Hides the Turtle and disables interactions with it.

Returns

Nothing

PenDown

Turtle.PenDown()

Sets the pen down to enable the turtle to draw as it moves.

Returns

Nothing

PenUp

Turtle.PenUp()

Lifts the pen up to stop drawing as the turtle moves.

Returns

Nothing

Move

Turtle.Move(distance)

Moves the turtle to a specified distance. If the pen is down, it will draw a line as it moves.

distance

The distance to move the turtle.

Returns

Nothing

MoveTo

Turtle.MoveTo(x, y)

Turns and moves the turtle to the specified location. If the pen is down, it will draw a line as it moves.

x

The x co-ordinate of the destination point.

y

The y co-ordinate of the destination point.

Returns

Nothing

Turn

Turtle.Turn(angle)

Turns the turtle by the specified angle. Angle is in degrees and can be either positive or negative. If the angle is positive, the turtle turns to its right. If it is negative, the turtle turns to its left.

angle

The angle to turn the turtle.

Returns

Nothing

TurnRight

Turtle.TurnRight()

Turns the turtle 90 degrees to the right.

Returns

Nothing

TurnLeft

Turtle.TurnLeft()

Turns the turtle 90 degrees to the left.

Returns

Nothing