Help page: Infecting Turtles

We need to write a script that does the following three actions:
1) change the turtle’s infected value from “false” to “true”;
2) change the turtle’s color from a healthy color to an infected color (we changed our turtles from a healthy blue to a sickly red); and
3) increase Kedama’s “infectedCount” variable by one.

Step 1: Change the turtle’s infected value
Select “add a new script” from the menu icon from the top of turtle1’s menu.

Go ahead and name your script; we called ours “Infect”.

To change turtle1’s infected value from “false” to “true,” first drag out the “turtle1’s infected” variable and drop it into your new script. Then, set the Boolean value to true to make the turtle sick.

Step 2: Change the turtle’s color
Now, we want to change the turtle’s color from a healthy color to an infected color. Select the “Kedama turtle” category and drag out the command that says “turtle1’s color.” Change the color in the box to whichever color you want to represent infected turtles.

Step 3: Increase the variable “infectedCount”
Finally, pull out the “infectedCount” variable from the Kedama menu and set it to increase by 1.

Here’s what our final script looks like:

BACK