Making Loops in Blockly (Ages 5-8)

In this activity we are going to use loop blocks, and you can even make your own loops in Blockly! In coding, a loop is a set of actions that happen multiple times - we will be using loops to make KINI do actions many times.

Follow the steps below to create Blockly Loops in the KINI App:

  1. Make sure that you have your KINI robot, and that it is connected to the internet. 

    KINI App Game Tab
  2. Open the app, and go to the Blockly tab by clicking the button in the bottom right corner. 

    Kini App Blockly Tab
  3. To find all of the loop blocks, open the dark blue Loops tab on the left side.

    • There are three green loop blocks, but in this activity we will use the first one

      Green loop blocks in the dark blue Loops tab.
  4. Click the Repeat 10 times block and drag it into the Repeat Once block. The 10 times can be changed to whatever number you want (this example is 4 times).

    Repeat 10 times block is dragged into the Repeat Once block, and changed to repeat 4 times.
  5. Use the orange KINI tab to find action blocks to put in the Repeat 4 times block. These blocks make up a loop. KINI will perform these actions for the number of times that you want.Action blocks are retrieved from the orange Kini tab.

    Action blocks are placed in the repeat 4 times block.


Congratulations! You just made your very first loop!  


The loop in the example above tells us that KINI will move backwards for 2 seconds, then stop, then rotate left for one second, then move forward for 20 centimeters; 4 times in a row.


Great work everyone! You just learned how to use loop blocks to move KINI! You can try out the same code with your KINI, or make your own! Good luck and have fun coding!