Page 219 - Scratch Programming Playground
P. 219

The clone starts by showing itself and moving forward. The
            clones should also wrap around the edges of the Stage just like
            the Spaceship sprite, so we use similar code to do that here.
                notice that the clones will set their own I am a clone vari-
            able to yes. This is so that the clones do not run the code in
            the when space key pressed script. The if then block in that
            script runs the code only if I am a clone is set to no.
                The clones move forward 10 steps at a time 50 times. That
            means the Energy Blast clones have a limited range and won’t
            keep moving forever. After the loop finishes repeating 50 times,
            the clone deletes itself and disappears from the Stage.










                                                              ASTeroID BreAker . . . In SpACe!  193
   214   215   216   217   218   219   220   221   222   223   224