TouchDevelop Turtle Graphics MIX

A quick introduction to turtle graphics commands in TouchDevelop.

Turtle graphicsTouchDevelop
1.0x

TouchDevelop Turtle Graphics MIX

Created 2 years ago

Duration 0:07:50
lesson view count 86
A quick introduction to turtle graphics commands in TouchDevelop.
Select the file type you wish to download
Slide Content
  1. TouchDevelop Turtle Graphics

    Slide 1 - TouchDevelop Turtle Graphics

    • Some basic commands for using the TouchDevelop Turtle
  2. Basic Movements

    Slide 2 - Basic Movements

    • ♻ turtle → forward(100)
    • Move forward 100 pixels
    • ♻ turtle → right turn(90)
    • Turn right 90 degrees
    • ♻ turtle → left turn(180)
    • Turn left 180 degrees
  3. Pen Commands

    Slide 3 - Pen Commands

    • ♻ turtle → pen up
    • Stop drawing – nothing will show as the turtle moves
    • ♻ turtle → pen down
    • Start drawing – color will be shown were turtle moves
    • ♻ turtle → set pen size(3)
    • Sets the width of the pen – how thick is the line drawn
    • ♻ turtle → set pen color(colors → red)
    • Draw red where turtle moves when pen is down
    • ♻ turtle → set pen color(colors → random)
    • Draw a random color where turtle moves when pen is down
  4. Touch Develop Coordinates

    Slide 4 - Touch Develop Coordinates

    • Top left corner is 0,0
    • Height in landscape on phones is 480, width is 800
    • Height in portrait on phones is 800, width is 480
  5. Moving to specific locations

    Slide 5 - Moving to specific locations

    • ♻ turtle → grid
    • Draw a grid on the screen – useful for debugging during design
    • ♻ turtle → go home
    • Sends the turtle to the center of the screen
    • ♻ turtle → move to(400, 100)
    • Moves the turtle to location x = 400 and y = 100
  6. Miscellaneous Useful Commands

    Slide 6 - Miscellaneous Useful Commands

    • ♻ turtle → fast
    • Tells the turtle to move very quickly
    • ♻ turtle → set speed(20)
    • Sets the speed of the turtle at 20 spaces per move
    • ♻ turtle → set heading(45)
    • Sets the turtle facing a specific direction based on compass degrees
    • ♻ turtle → set turtle picture(✿ turtle2)
    • Sets a new image for the turtle
  7. ♻ turtle → forward(100)

    Slide 7 - ♻ turtle → forward(100)

    • ♻ turtle → pen up
    • ♻ turtle → forward(20)
    • ♻ turtle → pen down
    • ♻ turtle → set pen color(colors → random)
    • ♻ turtle → circle(20)
    • ♻ turtle → right turn(90)
    • ♻ turtle → pen up
    • ♻ turtle → move to(500, 100)
    • ♻ turtle → move to(400, 100)
    • ♻ turtle → pen down
    • ♻ turtle → set pen color(colors → red)
    • for 0 ≤ i < 4 do
    • ♻ turtle → forward(100)
    • ♻ turtle → left turn(90)
    • end for
    • ♻ turtle → grid
    • ♻ turtle → go home