repetitionEverywhereCode's Code

Created by: shr

world

Events

When the world starts
Do:
world.my first method


While ( both ( ( chicken distance to bunny ) > 2 ) and ( square . color == green ) ) is true
Begin:
  Do in order
       chicken turn to face bunny
  bunny turn to face chicken
During:
  Do in order
       Do in order
       chicken turn to face bunny duration = 0 seconds
  bunny turn to face chicken duration = 0 seconds
  chicken move forward 1 meter
  chicken.Neck turn backward 0.1 revolutions duration = 0.25 seconds
  chicken.Neck turn forward 0.1 revolutions duration = 0.25 seconds
End:
chicken say Hello


Let move world.animals


When ( ( cow distance to chicken ) < 2 ) becomes true
Do:
  Do together
       cow say Moo duration = 2.25 seconds
  cow play sound cow.myMoo (0:02.250)


When G is typed
Do:
square set color to green duration = 0 seconds


When R is typed
Do:
square set color to red duration = 0 seconds


When P is typed
Do:
print ( bunny distance to chicken )


Methods

  world.my first method ( )
    No variables
       Do in order
       Do together
       chicken turn to face bunny
  bunny turn to face chicken
  Loop 5 times times
       chicken move forward 1 meter
  chicken.Neck turn backward 0.1 revolutions duration = 0.25 seconds
  chicken.Neck turn forward 0.1 revolutions duration = 0.25 seconds
  chicken say Hello
  Do in order
       While ( ( chicken distance to bunny ) > 2 )
       Do in order
       chicken turn to face bunny
  bunny turn to face chicken
  Do in order
       chicken move forward 1 meter
  chicken.Neck turn backward 0.1 revolutions duration = 0.25 seconds
  chicken.Neck turn forward 0.1 revolutions duration = 0.25 seconds
  chicken say Hello