User Guide

124
second item; otherwise the item is added to the end of the list.
It does not matter if there is only two (or one) items in the list.
Add the next half of the script inside the forever block, but below
the previous blocks. Where the diagram says “See Above”,
create an operator block that reads:
not (item[1] of ZSprites = item[1] of OZSprites and item[2] of
ZSprites = item[2] of OZSprites and item[3] of ZSprites = item[3]
of OZSprites)
This if block reduces the number of times that Scratch re-orders
the layers, which makes the code run faster. The OZSprites list
contains a copy of the ZSprites list from the last time the script
was run. If ZSprites has changed, then two things happen: the
script copies the items from ZSprites into OZSprites, and then
broadcasts three messages to tell the sprites which layers to
move to.
It builds a message by combining the name of the sprite with the
strings “GF”, “GL2”, or “GL3”, depending on which layer the
sprite should move to. You need to add three scripts to Billy: