1. Trang chủ
  2. » Giáo án - Bài giảng

Scratch creating movement elementary

13 200 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 13
Dung lượng 263,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

What you will learn• In this exercise we will learn: – How to create a simple movement programme called a script in programming language – How to make the sprite reverse in direction –

Trang 1

Using MIT Scratch for Programming and Control

Exercise 1 Creating movement

Year 11 DTG

2012

Trang 2

What you will learn

• In this exercise we will learn:

– How to create a simple movement programme

(called a script in programming language)

– How to make the sprite reverse in direction

– How to make the movement go forever (until

we stop the programme)

– How to make the sprite “walk” on the screen

using costumes

Trang 3

Simple movement

• One of the easiest programs to make is one that moves

a figure on the screen

• In Scratch the figure is called a Sprite.

• By default the sprite is a cat but there are many other

sprites that we can use and that we will see later………

Trang 4

Simple movement

• Click on the Control

button shown on the left

• A series of commands will

appear below the topics

box

• Select the first one (when

flag is clicked), and drag

it to the Scripts area of

the screen

Trang 5

Simple movement

Next click the Motion

button (to the left of the

Control button)

Drag the move 10 steps

button across and lock

it underneath the earlier

command Your

program should look

like the one on the

right

• Click the green flag

near the top right of the

Scratch screen to run

your program

Trang 6

Amending the program

• Now every time you click the green flag the sprite will

move by 10 steps

• You can change the amount of movement by altering the figure in the movement command

• Double click on the value in the movement control and type in a new value

Trang 7

Changing Direction

• In this program we will make

the sprite change direction We

will build on the program that

we have created already.

• Change the movement value

in your previous program from

10 to 40

• Click the control option again

and select the wait 1 secs

command

• Click the motion button and

add the point in direction 90

command below it

Trang 8

Changing Direction

• Click the motion button

and add the point in

direction 90 command

below it

• Click on the arrow beside

the 90 and select -90

from the list

• Add another movement

command and change

the value to match the

first

• Add another wait

command, and then

another 'point' command

Trang 9

Changing Direction

• Finally, at the top of the screen where there is a small image of the sprite, click the middle button next to the image of the sprite This makes the sprite change direction to match his movement

Trang 10

Repeated movement

• Repeated movement

(using forever)

• Often we want the

sprite to be animated

continuously until we

tell it to stop

• In order to get the

script that we have

written to loop use the

Forever instruction.

Trang 11

Walking sprite

• Click on the

costumes tab –

note that the cat

sprite comes with

two costume

• Rename the sprite

as cat

• Rename the

costumes as

Catwalk1 and

catwalk2

Trang 12

Walking sprite

Trang 13

• If you have followed all of the instructions correctly your sprite should walk backwards and forwards across the screen

• Save this project is your user area with the file name

catwalk1

Ngày đăng: 07/07/2017, 08:51

TỪ KHÓA LIÊN QUAN

w