Bot Builders : Level Up Your Robot

Cloning


1
  1. There are a lot of interesting ways to make your game harder. One way is by adding more obstacles!
  2. Let's add more poo! Normally, you can add more poo by duplicating the poo sprite, but since they all behave the same way, we can just clone them.

2
  1. First, let's clean up our sprites panel.
  2. Delete the other poo and leave one poo sprite.

3
  1. To create clones, attach this code block to the sprite poo.
  2. This says that when you click the green flag, 3 clones of the sprite will be created.

4
  1. Clones behave quite differently, you have to use When I start as a clone to dictate their behaviour.
  2. Create this script block and attach it to the poo sprite.
  3. If you notice, the script block is similar to the blocks attached to when green flag clicked
  4. They basically do the same thing but this time, the new script block only works for clones.

5
  1. Since we're using clones now, you can dictate how many obstacles can be created effortlessly!
  2. Try increasing the number of clones.
  3. Here's a challenge, when the score reaches 10, the number of obstacles will double.

BACK NEXT