If you don't see 3d graphics on this page, click for help.
| world.my first method ( )
distanceToGumdrop = 1 , distanceToGumdrop2 = 1 |
||
| // Determine how far the fish is from each gumdrop. | ||
| distanceToGumdrop set value to ( fishy distance to gumdrop ) | ||
| distanceToGumdrop2 set value to ( fishy distance to gumdrop2 ) | ||
| // Have the fish eat the closer gumdrop. | ||
| If ( distanceToGumdrop > distanceToGumdrop2 ) | ||
| fishy.eatGumdrop whichGumdrop = gumdrop2 | ||
| Else | ||
| fishy.eatGumdrop whichGumdrop = gumdrop | ||
| fishy.eatGumdrop ( [Obj] whichGumdrop)
No variables |
||
| // Swim to the gumdrop. | ||
| fishy turn to face whichGumdrop | ||
| fishy move to whichGumdrop | ||
| // Make the gumdrop disappear to give the illusion of being eaten. | ||
| whichGumdrop set opacity to 0 (0%) duration = 0 seconds | ||
| // If the fish ate a red gumdrop, it doubles in size. If it ate a yellow gumdrop, it gets smaller. | ||
| If ( whichGumdrop . color == (1, 0, 0) ) | ||
| fishy resize 2 | ||
| Else | ||
| fishy resize 0.5 | ||