parametersChallenge's Code

Created by: Susan

world

Events

When the world starts
Do:
world.my first method


When is clicked on anything
Do:
bunny.eat ( object under mouse cursor )


Methods

  world.my first method ( )
    No variables
       bunny say I'm hungry!! Let's eat!


bunny

Methods

  bunny.eat ( [Obj] food)
    No variables
       // Right now the bunny will only visit the carrot and eat it no matter what is clicked on
  // Edit this method so any of bunny's treats can be clicked on and he can eat them!
  // WARNING: Bunny only likes healthy treats! He should not eat any cookies!
  // Add an EVENT to run the bunny.eat event when a treat is clicked on!
  bunny turn to face food
  bunny move ( ( ( bunny distance to food ) - 1 ) ) toward target = food
  If ( either ( either ( either ( food == cookie ) or ( food == cookie2 ) , or both ) or ( food == cookie3 ) , or both ) or ( food != ground ) , or both )
       bunny say That's no good!
  Else
    bunny turn forward .18 revolutions
  food set isShowing to false duration = 0 seconds
  bunny turn backward 0.18 revolutions


  bunny.eat2 ( [Obj] food)
    No variables
       bunny turn to face food
  bunny move ( ( ( bunny distance to food ) - 1 ) ) toward target = food
  If ( food == cookie )
       bunny say That's no good!
  Else
    If ( food == cookie2 )
       bunny say That's no good!
  Else
    If ( food == cookie3 )
       bunny say That's no good!
  Else
    bunny turn forward .18 revolutions
  food set isShowing to false duration = 0 seconds
  bunny turn backward 0.18 revolutions