Skip to content

Purogo CustomizingOurDrawings

Thomas E. Enebo edited this page May 20, 2012 · 2 revisions

Let's play with our firstdrawing again, but we will make some changes and call it (square3):

turtle("no longer a square", :pig) do
  block :iron_ore           
  forward 5
  turnright 90
  block :pumpkin
  forward 5
  turnright 90
  block :air
  forward 5
  turnright 90
  block :sandstone
  forward 5
end

Now draw this (/draw square1) and check it out. Notice that the chicken has been replaced by a pig and also notice we have three different lines and it is a C shape instead of a square. First line of note:

turtle("no longer a square", :pig) do

We see a new second argument :pig. Simple huh? Check out this list of valid CreatureTypes. The other obvious new method we have is:

  block :pumpkin

This changes how all subsequent forwards will draw from that point on. Each successive block just changes to a new BlockTypes. Why is it not a block though?

 block :air

Air has no graphic. Our creature is still moving forward, but it is replacing the current blocks with air. So by using air we can selectively turn off drawing. Here is an example of performing a dashed line:

turtle("Dashed line") do
  4.times do
    block :sandstone
    forward 2
    block :none
    forward 2
  end
end

So far we have only used 'turnright' and 'forward' to orient and move while we draw. Lets find out what else we can do in Purogo-MovingAround.

Clone this wiki locally