Home Page




Learning Objective:

To move an object WHEN CLICKED.

To stop an object from moving when the background is clicked.


Success Criteria:

I can program a character to move WHEN CLICKED.

 I can use the WHEN CLICKED feature and explain what it does.

 I can use the STOP button to stop the character moving when the background is clicked.


Last week, you created a background and added in a character/s that moved automatically when the green play button was clicked.


In today's lesson, you'll be using the WHEN CLICKED button. When you drag this button in, a drop down menu comes down and you can either click on the character or the background to start the character moving.


Now, let's practise what you've learned.

  • Log on to Purple mash
  • Open your 2Dos and clicked on
  • Free code chimp
  • Add your own background and character in Design Mode.
  • Add in the WHEN CLICKED button and experiment with starting the character moving by clicking on the character. Where would you like your character to move to? Would you like your character to move right or left?
  • Keep on practising how to move your character(s) in different directions. When you're happy about your learning, move on to Task 2.


Task 2

when we press the WHEN CLICKED button, the character moves but it keeps on moving. We now want the character to stop. Can you add a code to make the character stop when the background is clicked (apart from pressing the red square “stop” button as this stops the whole programme).



Create a new Free code activity using the WHEN KEY button or the WHEN SWIPED button with a background and a character moving. You can add more characters and use WHEN CLICKED WHEN SWIPED and WHEN KEY buttons.


Have fun!