Skip to main content

Lesson 1: Draw a Square

The [move robot pen] block moves the Pen tool up and down on the VR Robot. This example will have the VR Robot draw a square on the Art Canvas Playground.

black square
  • Drag in the [move robot pen] block and attach it beneath the [When started] block.
    move pen down

    For Your Information

    The [move robot pen] block can be used to pick up and put down the Pen tool on a VR Robot.

    set pen position
  • Drag in the [Drive for] block and attach it below the [move robot pen] block. Set the parameters of the [Drive for] block to 600 millimeters (mm).
    drive for block
  • Drag in the [Turn for] block and attach it beneath the [Drive for] block. Set the parameters of the [Turn for] block to turn right 90 degrees.
    turn for block
  • To draw the second side of the square, duplicate the [Drive for] and [Turn for] blocks. To duplicate, right click or long press on the [Drive for] block.
    Duplicate blocks
  • Additional [Drive for] and [Turn for] blocks are now added to the stack.
    4 code block
  • To draw the last two sides of the square, duplicate the [Drive for] and [Turn for] blocks. Right click or long press on the first [Drive for] block in the stack.
    duplicate two blocks
  • The stack of blocks will then be duplicated.
    stack of blocks
  • Select the “Open Playground” button to open the playground.
    Open Playground
  • Open the Art Canvas Playground.
    Art Canvas
  • Select the “Start” button to test the project.
    Start
  • The VR Robot will drive forward for 600 millimeters (mm) and then turn right for 90 degrees, while drawing with the Pen tool. The VR Robot will repeat these behaviors four times to draw all four sides of the square.
    black square
  • Select the “Reset” button to reset the Playground and move the VR Robot back to the starting position.
    Restart Feature

    For Your Information

    The [Set Pen color] block can be used to change the colors of the pen.

    set pen color

Select the Next button to continue with the rest of this Lesson.