A family of enemies

Try itYour own words

A word saves you from repeating steps inside one script. A family saves you from copying a script onto many characters.

A family is one script that lots of characters share. Every character in the family runs it.

The family's script

This is the script your family will share. Press Play Play this script to see what one family member does.

learn to dance
hop left 1 block
jump
hop right 1 block
end
​
repeat forever
dance
end

The slime dances, waits 2 seconds, and dances again, for ever.

Make the family in your game

  1. Press Copy Copy, at the bottom of the script in the code box above.
  2. Press Open your game here, in the builder below.
  3. Press the Game button Game settings, under the map. It is the one with the gear.
  4. In Game Settings, find Scripts and press Families Families. A script window opens, with a family called Family 1.
  5. Press Rename and call it Dancers.
  6. Press Code Code, and paste the script in.
  7. Press Save Save.

Put your jumpers in the family

Do this for each jumper in level 1.

  1. Press Select Select, under the map, and click the jumper.
  2. At the bottom of its settings, press Character scripting Character scripting.
  3. In the Family list at the top of the window, pick Dancers.
  4. Take out everything in the jumper's own script. It does not need it now.
  5. Press Save Save.

Press Play Play game, under the map. Every jumper dances, and none of them has a script of its own.

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.