Scratch 2
eBook - ePub

Scratch 2

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub
Book details
Book preview
Table of contents
Citations

About This Book

The ability to code will become an essential skill in a fast-changing future. Coding education is a part of the national curriculum in many countries, such as the UK, Finland, Japan, and China. Students are able to acquire computational thinking skills, which can help them to analyze and solve problems logically. CodingTime is a coding education academy located in Seoul, South Korea. For many years, we have helped students achieve their educational goals. This book will help students to excel in programming. Students will learn how to use the Scratch program to code in a fun and easy way. They can make algorithms and get a glimpse of mathematics and science principles used in programming, while building their own project.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Scratch 2 by Time Education C&P in PDF and/or ePUB format, as well as other popular books in Education & Education Technology. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9791197120183

Chapter5. Mouse input

Mouse input
1. Touch the hedgehog
2. Grab the grasshopper

01 Touch the hedgehog

What to make
When you place the mouse over the hedgehog, its appearance will change.
A sound will play as it changes.
Play the project
Go to this website:
https://scratch.mit.edu/projects/440089087
Changing the costumes when sprite is clicked
How to make
How does the shape and appearance of the hedgehog change?
(HINT: Check the [Costumes] tab of the hedgehog sprite.)
When does the hedgehog change its looks?
(HINT: See sensing palette.)
What sound can you hear when the hedgehog changes its looks?
(HINT: See the [Sounds] tab of the hedgehog sprite.)
New blocks
Make sounds
Sense if the mouse pointer is touching the sprite
Programming
Create a new project by clicking [File] > [New] or [Create].
Delete the cat by clicking [x]
button. Click the new sprite
button and select [Hedgehog]
sprite.
Drag and place the hedgehog
anywhere on the stage.
Click the [Costumes] tab
to see the names of the
costumes. Pick the costumes
the sprite will change to. (For
example, Hedgehog-a and
Hedgehog-d.)
Set the Hedgehog’s costume
as Hedgehog-a when green
flag is clicked.
[Events] > [When Green Flag
Clicked]
[Looks] > [Switch Costume to
Hedgehog-a]
Check if the mouse pointer
touches the hedgehog.
[Control] > [If O Then]
[Sensing] > [Touching O?]
When the mouse pointer
touches the hedgehog,
make the costume switch to
hedgehog-d.
[Looks] > [Switch Costume
to O▼] - click ▼ to select
hedgehog-d.
After costume switches, have
it make a “pop” sound.
[Sound] > [Start Sound O▼]
Place the blocks under the [switch
costume to hedgehog-a] block.
Click the green flag to run the project.
To see what happens, touch the hedgehog with your mouse.
Nothing happens because
after the green flag button is
clicked, the computer senses a
mouse movement only once.
Therefore, the [forever] block is
essential for repeatedly sensing
a mouse input.
[Control] > [Forever]
Click the green flag to run the project.
To see what happens, touch the hedgehog with your mouse.
On the bottom right corner, click the [choose a backdrop] button and select
[Garden-rock] backdrop.
Change the title to “Touch the hedgehog.”
Practice
Besides switching the costume and making a “pop” sound, make other events
happen when the mouse-pointer touches the hedgehog.
memo
02

02 Grab the grasshopper

What to make
A grasshopper is jumping everywhere!
Click it and it will say “You got me!”
Play the project
Go to this website:
https://scratch.mit.edu/projects/440089252/
Repeating until a condition is satisfied & Clicking the mouse
How to make
How does the grasshopper move?
When does the grasshopper stop moving?
New blocks
Go to random position
Join two conditions
Sense if the user clicks the mouse
Repeat until a condition
is satisfied
Sense when mouse touches a sprite
Programming
Create a new project by clicking [File] > [New] or [Create].
Delete the cat by clicking
[x] button. Click the new
sprite button and select
[Grasshopper] sprite.
Downsize it from 100 to 50.
Make the grasshopper go to a
random position.
[Events] > [When Green Flag Clicked]
[Motion] > [Go to random position]
The grasshopper should not move
infinitely. It should repeat only until a
specific condition is satisfied.
[Control] > [Repeat Until O]
The condition that should be satisfied is clicking the grasshopper. In
other word...

Table of contents

  1. 시작