Upload
abd-rahman-bin-rahim
View
18
Download
0
Embed Size (px)
DESCRIPTION
Scratch Tutorials by Rosdi
Citation preview
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
1
Scratch Interface
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
2
Creating Games with Scratch
Open the program and click the icon SCRATCH Control to open the Control programming block section.
Picture 1
Click on the block "when (the green flag image) click", then drag and drop the programming block on screen programming editor as shown in the figure below. Each program is made with SCRATCH usually run by clicking on the "green flag image". It means the program execution on the programming block will be executed when the image is clicked the green flag.
Picture 2
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
3
Picture 3
Click the icon Motion to open Motion programming block.
Picture 3
Click on the block "move 10 steps", then drag and drop the programming block on screen programming editor as shown in the figure below. Programming block "move 10 steps" is useful to run a sprite object or as many as 10 steps.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
4
Picture 4
Picture 5
Click the green flag image on the right above to run the program.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
5
Picture 6
It can be seen that every time we click the green flag image then the object will move a little.
To make the object move farther we can use repetition block or blocks "forever".
Click the icon Control to open Control programming block.
Picture 7
Click on the block "forever", then drag and drop the programming block on screen programming editor, and assemble blocks of programming as seen in the image below.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
6
Picture 8
Picture 9
Click the green flag image on the right above to run the program.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
7
Picture 10
It can be seen that when we click on the green flag image object moving to the right end. Here what happens is a repetition block "move 10 steps" in many times.
Click the stop button located on the top right so that the program stops running. Stop button is used to terminate a program.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
8
Picture 11
Set the object / sprite that were back in the middle of the screen.
Picture 12
Now we will arrange to have the object / sprite will change direction when hitting the left or right edge of the screen.
Click the icon Motion to open Motion programming block.
Picture 13
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
9
Click on the block "if on edge bounce", then drag and drop the programming block on screen programming editor, and assemble blocks of programming as seen in the image below.
Picture 14
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
10
Picture 15
Click the green flag image on the right above to run the program.
Picture 16
It can be seen that the object / sprite will change direction when hitting the edge of the screen, but although the orientation of the object changed direction / sprite to be reversed.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
11
In order for an object / sprite not be reversed click icon "just flip left-right" as shown below.
Picture 17
It can be seen that once clicked the icon "just flip left-right" orientation of the object will not be reversed.
However, when considered in the movements of objects / sprites tend to be too fast.
To reduce the speed of the object / sprite may be useful blocks "wait 1 secs". Click the stop button located on the top right so that the program stops running.
Picture 18
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
12
Click the icon Control to open Control programming block.
Picture 19
Click on the block "wait 1 secs", then drag and drop the programming block on screen programming editor, and assemble blocks of programming as seen in the image below.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
13
Picture 20
Picture 21
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
14
Click the green flag image on the right above to run the program.
Picture 22
It can be seen that the present movement of the object / sprite becomes slower, or maybe even too slow.
Click the stop button located on the top right so that the program stops running.
Picture 23
To change the speed of change "wait 1 secs" to "wait 0:25 secs".
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
15
Picture 24
Click the green flag image on the right above to run the program.
Picture 25
It can be seen that the speed of the object / sprite to be a little faster. Object / sprites that move only using one image, so that the object / sprite seem
more alive should be used more than 1 picture. Click the stop button located on the top right so that the program stops running.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
16
Picture 26
Click the "Costumes" to see the costumes or objects animated images / sprites there.
Picture 27
It can be seen that the object / sprite has 2 costume that can be used for animation
Click Scripts to display the screen again programming editor
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
17
Picture 28
Click the icon Look to open Look programming block.
Picture 29
Click on the block "next costume", then drag and drop the programming block on screen programming editor, and assemble blocks of programming as seen in the image below.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
18
Picture 30
Picture 31
Click the green flag image on the right above to run the program.
ROSDI BIN TUKIBON ICTL YEAR 6 / KOTA TINGGI
19
Picture 32
It can be seen that the animated object / sprite look more alive with a variety of costume so that the object appears to be under way.