Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 2.

Similar presentations


Presentation on theme: "Lesson 2."— Presentation transcript:

1 Lesson 2

2 Rock, Paper, Scissors! We will be using the LEDs and the motion detector built in to the micro:bit (accelerometer) that can detect movement. This will tell the micro:bit when we have shook the micro:bit, and when to display the ‘rock, paper, or scissors’.

3 Rock, Paper, Scissors!

4 Minecraft Creeper Face

5 Rock, Paper, Scissors!

6 Rock, Paper, Scissors! USE OR

7 Rock, Paper, Scissors! Step One Rename your script

8 Rock, Paper, Scissors! OR click THEN OR click Step Two & Three image
The aim of the lesson create image OR click

9 Rock, Paper, Scissors! Step Four The aim of the lesson Add two more

10 Rock, Paper, Scissors! Step Five The aim of the lesson

11 Click the ‘LEDs’ to turn them on, we need three symbols.
Rock, Paper, Scissors! Step Six Rock Paper Scissors The aim of the lesson Click the ‘LEDs’ to turn them on, we need three symbols. Click ‘ok’ when done

12 Rock, Paper, Scissors! Step Seven Click before ‘image’ then ‘var’
You should see ‘var img :=‘ The aim of the lesson

13 Click the add button to create a new line
Rock, Paper, Scissors! Step Eight The aim of the lesson Click the add button to create a new line

14 Delete the ‘2’ and replace it with ‘3’
Rock, Paper, Scissors! Step Nine Delete the ‘2’ and replace it with ‘3’ The aim of the lesson

15 Rock, Paper, Scissors! Step Ten
Then times by 5 (* 5). This will multiply our random number 0, 1 or 2 by 5, to select 0, 5, or 10. These are our offset values – how the micro:bit displays and chooses each image individually)

16 Click before ‘math’ then ‘var’
Rock, Paper, Scissors! Step Eleven Click before ‘math’ then ‘var’

17 Click before ‘math’ then ‘var’
Rock, Paper, Scissors! Step Twelve Click before ‘math’ then ‘var’

18 Rock, Paper, Scissors! Final Step - Thirteen!
Click the ‘var img := image…’ line and click the add button. Type ‘input’ in the search bar and click the option that appears

19 Final Step – Thirteen (continued)!
Rock, Paper, Scissors! Final Step – Thirteen (continued)! Drag the three lines of code below ‘end’ into the ‘add code here’ line.

20 Rock, Paper, Scissors! Run It!
Click ‘SHAKE’ button until you have seen that rock, paper, AND scissors all display on the micro:bit!

21 Your Turn! Create the rock, paper, scissors game using the steps in this presentation! If you finish – have a go at changing the design – whatever the micro:bit can display with the LEDs you can use!


Download ppt "Lesson 2."

Similar presentations


Ads by Google