12
© Nichola Wilkin Ltd. 2014 Scratch Lesson 6 1

Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Scratch

Lesson 6

1

Page 2: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Starter

1. Log onto the Scratch website: https://scratch.mit.edu/

2. Read through the rest of the slides. We started creating our own games earlier this year. It is now chance to test your knowledge of this.

2

Page 3: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Objective

Use a variable

• All of you will:• Create a variable that changes its value when a sprite is clicked.

• Most of you will:• Set a variable’s starting value and count up and down with variables.

• Some of you will:• Create a working game that keeps score and has a time limit.

3

Page 4: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Watch the embedded video on the website titled: Random Location Video

4

Page 5: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

How much do you remember?

1. When does the script run?

2. Where would you find the option to change the colour of the sprite?

3. Where would you find the “Go to X and Y” option?

4. Where would you find the random option?

5

Page 6: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Over to you…

•Change the background and add a sprite of your choice.

•Add the script as shown below.

6

Page 7: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Watch the Variable Tutorial Video embedded on the website

7

Page 8: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

How much do you remember?

1. What is a variable?

2. How can you make a new variable?

3. How can I change the value of my variable?

4. When do you want the variable to start from 0 again?

5. How can you set the variable to 0?

8

Page 9: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Use a variable

• Make a variable called Score.

• Change the script so that when your sprite is clicked it will add one to the score.

• Change the script so that when the green flag is clicked the score will be set to 0.

• Try out your game.

9

Page 10: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

• Make your own game which has two sprites.

• Make one follow your pointer and the other move around the screen on its own.

• When one sprite touches the other, change the score and then move to another part of the screen.

• Try out different ideas to make your gamemore interesting and exciting to play.

Over to you…

10

Page 11: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

Counting down

• What will this code do?

• Add this code to your game to make a time limit so that after 60 seconds the game will stop.

• The “=” can be found in

11

Page 12: Scratch - holytrinity.leeds.sch.uk•Set a variable’s starting value and count up and down with variables. • Some of you will: •Create a working game that keeps score and has

© Nichola Wilkin Ltd. 2014

EXT: Create your own game

Try to create a game that includes a variable (could be lives or score) that has an objective.

I am looking to try and set up an area on the Scratch website for all of your creations.

This task may take a few attempts to complete so please use your time wisely and make sure it reflects the time given.

12