parameterChallengeSolution's Code

Created by: SHR



When the world starts
Do: first method

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

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


Methods ( [Obj] objectToEat)
    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 event when a treat is clicked on!
  bunny turn to face objectToEat
  bunny move ( ( ( bunny distance to objectToEat ) - 1 ) ) toward target = objectToEat
  If ( either ( either ( objectToEat == cookie ) or ( objectToEat == cookie2 ) , or both ) or ( objectToEat == cookie3 ) , or both )
       bunny say That's no good!
    If ( objectToEat == ground )
       bunny say That's the ground!
    bunny turn forward .18 revolutions
  objectToEat set isShowing to false duration = 0 seconds
  bunny turn backward 0.18 revolutions