This document provides instructions for creating a Tom and Jerry-style game using the Scratch programming environment. It outlines 5 stages of the game including adding sprites like a cat and mouse, programming their movements and interactions, adding variables to track lives and points, and including title screens. The steps provide detailed instructions for coding each sprite's behavior using Scratch blocks for events, controls, operators, looks, and motion. Screenshots illustrate examples of the game at each stage of development.
2. LINK DOWNLOAD SCRATCH
Pre-requisite Windows 10
Please install these softwares as the order:
1. Scratch:
https://downloads.scratch.mit.edu/desktop/Scratch%20Desktop%20S
etup%203.6.0.exe
4. Panel Block
Panel
Block
Motion Looks
Example:
Move, change
direction, Go to a
position
Example:
Say somthing,
think, change
costume
Sound
Example:
Play sound,
change sound
Events
Example:
When Cat hit
mouse, green flag
clicked
Control
Example:
IF Cat hit mouse
what to do
Sensing
Example:
Condition Cat hit
mouse
WHAT ARE THEIR FUNCTION?
7. OK, Lets rock!
Game Flow
Test Game I: Sprint Cat
Test Game II: Sprint Donut
Test Game III: Donut hit cat and cat eat mouse
Test Game IV: Add Life, Points, Name
Test Game V: Screen Title
8. Steps make Game 1-2
Sprite Cat
1. Move Sprite Cat to left side and change size to “50”
2. Change Size to “50”
3. Add Motion > “move 10 steps”
4. Add Looks > “Say “Hello” for 2 secs”
5. Add Sounds > “play sound “Meow” until Done”
6. Add Events > “when “flag” clicked” on top of code block
7. Add Sensing > “ask “Whats your name?” and wait” put under Event
8. Test Game I
Sprite Donut
1. Add Sprite “Donut”
2. Change Size “50”
3. Click Sprite Donut > choose tab “Costume” > Duplicate “Donut”
4. Paint new Costume of Donut
9. Steps make Game 1-2
Sprite Donut
5. Back to Tab Code, Add Control > “wait 1 seconds”
6. Add Looks >“Next costume”
7. Add Control > “forever”, Move other blocks inside control
8. Add Events > “when flag clicked”
9. Add Control > “if ... Then”
10. Add Sensing > “key “space” pressed” then” as condition of Control
11. Test Game II
10. Steps make Game 3
Add Sprite Mouse and change size to “30”:
1. Add Events > “when flag clicked”
2. Add Control > “forever”
3. Add Motion > “set x to …” into Control 2
4. Add Operators > “pick random “-191” to “191”
5. Add Motion > “set y to …” into Control 2
6. Add Operators > “pick random “-131” to “131”
7. Add Looks > “show”
8. Add Control > “wait 5 seconds”
9. Add Looks > “hide”
10. Add Control > “wait 2 seconds”
180
-180
240-240
Screen Coordinate
x
y
x,y
11. Steps make Game 3
Sprite Cat:
1. Remove Motion > “move 10 steps”
2. Remove Motion > Add Looks > “Say “Hello” for 2 secs”
3. Remove Sounds > “play sound “Meow” until Done”
4. Keep Events > “when “flag” clicked”
5. Keep Sensing > “ask “Whats your name?” and wait”
6. Add Control > “forever” under Events 4
Put below Code block inside Control 6 “forever”
7. Add Control > “if .... Then”
8. Add Sensing > “key “up arrow” pressed” as condition of Control 7
9. Add Motions > “change y by 2” into inside Control 7
10. Add Control > “if .... Then”
11. Add Sensing > “key “down arrow” pressed” as condition of Control 10
12. Add Motions > “change y by -2” into inside Control 10
13. Add Control > “if .... Then”
14. Add Sensing > “key “left arrow” pressed” as condition of Control 13
15. Add Motions > “change x by -2” into inside Control 13
0
90
180
270
180
-180
240-240
Screen Coordinate
x
y
x,y
Direction
12. Steps make Game 3
Sprite Cat:
16. Add Control > “if .... Then”
17. Add Sensing > “key “right arrow” pressed” as condition of Control 16
18. Add Motions > “change x by 2” into inside Control 16
19. Add Control > “if … then”
20. Add Sensing > “touching mouse” as condition of Control 19
21. Add Looks > “say “Alhamdulillah” for 2 seconds” into inside Control 19
22. Add Control > “if … then”
23. Add Sensing > “touching donut” as condition of Control 22
24. Add Looks > “say “Astaghfirullah” for 0.5 seconds” into inside Control 22
Sprite Donut:
1. Keep Events > “when flag clicked”
2. Keep Control > “forever”
3. Remove Looks > “Next costume”
4. Remove Control > “if … then”
5. Add Motion > “point in direction “180” under Events 1
13. Steps make Game 3
Sprite Donut:
Put below Code block inside Control 2 “forever”
6. Add Motion > “move 5 steps”
7. Add Looks > “switch costume to “donut”
8. Add Control > “if … then”
9. Add Sensing > “touching “edge”’ as condition of Control 8
10. Add Motion > “set y to “127” into control 8
11. Add Motion > “set x to ….“ into control 8
12. Add Operators > “pick random “-180” to “180”” as value of Motion 11
13. Add Control > “if … then”
14. Add Sensing > “touching “Sprite1”’ as condition of Control 13
15. Add Looks > “Switch costume to “donut2” into Control 13
16. Add Control > “wait 1 second”
17. Add Motion > “set y to “127” into Control 13
14. Steps make Game 3
Sprite Donut:
Put below Code block inside Control 2 “forever”
18. Add Motion > “set x to ….“into Control 13
19. Add Operators > “pick random “-180” to “180”” as value of Motion 18
20. Test Game III
16. Steps make Game 4
Sprite Sprite1:
1. Make a Variable with name “Life” and set for All Sprites
2. Make a Variable with name “Points” and set for All Sprites
3. Make a Variable with name “name” and set for All Sprites
Put below code blocks under Event “when flag clicked”
1. Add Variable > “hide variable “name”
2. Move sensing > “ask “whats your name” and wait“ into here
3. Add Variable > “set name to ….”
4. Add Sensing > “answer” as a value of Variable 4
5. Add Event > “broadcast “startgame”
Put below code blocks under Event “when I receive “startgame”
1. Add Event > “when I receive “startgame”
2. Add Variable > “show variable “name”
3. Drag and move Control > “forever” into here
17. Steps make Game 4
Sprite Sprite1:
Put below code blocks under Event “when I receive “startgame”
4. Add Control > “if … then” inside Control “forever”
5. Add Operations >” … = 0 “ as condition of Control 4
6. Add Variable > “Life” as value Operation 5
7. Add Control > “stop all” into Control 4
8. Go to Control > “if “touching Donut” then”
9. Add Variable > “set “Life” to ….” under Looks “say Astaghfirullah for 0.5 seconds”
10. Add Operation > “variable “Life” - 1” as value of Variable 9
11. Go to Control > “if “touching mouse1” then”
12. Add Variable > “set “Points” to ….” under Looks “say Alhamdulillah for 2 seconds”
13. Add Operation > “variable “Points” + 1” as value of Variable 12
18. Steps make Game 4
Sprite Donut:
Put below code blocks under Event “when I receive “startgame”
1. Add Event > “when I receive startgame”
2. Move and drag code blocks start from Motion > “Point in direction 180” into here
Put below code blocks under Event “when flag clicked”
1. Add Looks> “switch costume to donut”
Sprite Mouse1:
Put below code blocks under Event “when I receive “startgame”
1. Add Event > “when I receive startgame”
2. Add Variable > “set Life to 3
3. Add Variable > “set Points to 0
4. Move and drag code blocks start from Control> “forever” into here
Test Game IV
20. Steps make Game 5
Sprite Donut:
Put below code blocks under Event “when I receive “startgame”
1. Insert Looks > “show” under Event
Put below code blocks under Event “when flag clicked”
1. Insert Looks > “hide” under Event
2. Add Motion > “set y to 127”
3. Add Motion > “set x to ….”
4. Add Operations > “pick random -180 to 180” as value of Motion 3
Sprite Mouse1:
Put below code blocks under Event “when I receive “startgame”
1. Insert Looks > “show” under Event
Put below code blocks under Event “when flag received”
1. Insert Looks > “hide” under Event
21. Steps make Game 5
Sprite Sprite1:
1. Click Stage and click tab “Backdrops”
2. Add New Backdrops “Room 2”
3. Click Text and give Game Tittle “Kejar Tikus, Awas Donat”
4. You can add more text
5. Once finished, back to Tab “Code”
6. Choose “Sprite 1”
Put below code blocks under Event “when flag received”
1. Insert Looks > “switch backdrops to “Room 2”” under Event
2. Insert Looks > “hide” under Variable “hide variable “name””
3. Add Control > “wait until ….”
4. Add Sensing > “key “any” pressed” as value of Control 3
Put below code blocks under Event “when I received “Startgame””
1. Insert Looks > “switch backrdrops to “Wall 1”” under Event
2. Insert Looks > “show” under variable “show variable “name””
Test Game V