Children's programming Scratch Lesson: Let the cat go up

Scratch download learning materials - extraction code: rnqf

Background: Currently on the market about Scratch graphical programming software with a lot, but I recommend using the latest version of Scratch2.0, I use a ArduinoScratch software, while all the features and Scratch2.0 this 2 Arduino programming , I am lazy, so he did not like to download 2 software, you use one, you can program the software to choose according to their preferences, to achieve our objective on the line
a, Scratch interface introduction
Scratch interface is divided into the stage area, the role of area, block area, script area, as shown below:
Here Insert Picture Description
execute Second, the control program, stop and full-screen display
Here Insert Picture Description
Third, write kittens go up game

We open the software, you will find in the stage area and the role of the default area will appear a kitten, we aim of this lesson is to let the kittens go through the program together.

The first step: modeling switch

What shape is it to switch? Animation is the cat walk least two operations can be decomposed into forming screen fast switching (which can be decomposed into a plurality). Scratch role in the kitty cat1 default two modeling (modeling we can both own name), we have these two roles can be repeatedly used alternately to simulate the way a cat walk.

1. Click the role of the District of kittens

2. Click the area above modeling module

As shown below:
Here Insert Picture Description
Step two: build "cat move the feet," the script

1. Click on the "Script" - click the "action" - to "move 10 steps" of the module onto the script area

This time we click on 'Green Flag (execute the script) ", you will find our cat will not move, because the script does not execute the script module area, we need to execute the script module area and drag the script and" mobile step 10 "is connected to the module.

2. Click the "Script" - click on "events" - the "Green Flag" of the module onto the script area

Script below:
Here Insert Picture Description
The third step: to build a "cat walk up the pace," the script

And the above steps almost, I will not explained directly on the map script
Here Insert Picture Description
wait Module ": Because the shape of the speed control switch, if you remove this module, you will find the kitten run fast.

"Repeat": We have to keep switching modeling

"Edge hit on the rebound": Without the module, our cat would have been run out of the stage area, with this script module, kitten kittens will automatically return to the edge.

Step Four: Click "Green Flag" begin executing your program

When running the program, we find the kitten stage area actually walking backwards return, how does this solve?

Click on the top left of the role of the cat area "!" In the pop-up options, click "Allow only about flipping", as shown below
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/sdke117/article/details/93486344