One change, every enemy

Try itYour own words

Here is what a family is for. Change the family's script once, and every member changes.

Try a change in the code box

learn to dance
hop left 1 block
jump
hop right 1 block
end
​
repeat forever
dance
end
  1. Press Play Play this script and watch the gap between dances.
  2. Press Stop Stop.
  3. In Code Code, click 2 seconds. A list of times drops down.
  4. Click 0.5 seconds in the list.
  5. Press Play.

The slime hardly rests now. In the code box, that changed one slime. In your game, the same change reaches every Dancer.

Add Dancers to level 2

  1. Press Open your game here, in the builder below, and go to level 2.
  2. Place two more enemies, before the door.
  3. For each one, press Select Select, click it, and press Character scripting Character scripting.
  4. In the Family list, pick Dancers. Take out the enemy's own script, and press Save Save.

You now have Dancers in both levels.

Change the family

  1. Press Select and click any Dancer. Press Character scripting.
  2. Press Edit family. The family's script opens.
  3. Change wait 2 seconds to wait half a second. Press Save.
  4. Press Play Play game, under the map. Then look at level 1, and play that too.

Every Dancer, in both levels, now dances faster. You changed one line, once.

This makes a new game in your Lab and opens the builder right here. It is free.

This section ticks itself when you press Play Play this script in the code box.

Press Play in the code box to finish this section.