🍪 Scratch 第二课
Lesson 2: Cookie Clicker — 做一个点点点小游戏

点饼干,得分数,比比谁快!

Click the cookie, score points, beat the clock!

🐱 Welcome Back! — 欢迎回来!

🇨🇳 中文

第一课里,你让小猫 说话、走路,还做了一个 接苹果 🍎 的游戏。太棒了!

今天我们做一个全世界小朋友都爱玩的游戏:点点点饼干 🍪 — 英语叫 Clicker Game。在 15 秒里,你点饼干越多次,分数越高!

🇬🇧 English

In Lesson 1, you made the cat talk, move, and built a Catch the Apple 🍎 game. Awesome!

Today we make a game kids everywhere love: a Cookie Clicker 🍪 — a clicker game. Click the cookie as many times as you can in 15 seconds to get a high score!

🌟 New things you'll learn — 你会学到的新东西

  • 📦 Variables(变量)— 怎么记住分数和时间 / how to remember score and time
  • 👆 when this sprite clicked(当角色被点击)— 一个全新的开始积木 / a brand-new start block
  • ⏱ A countdown timer — 倒计时!/ a countdown timer!
  • 🏆 Win & lose — 游戏怎么结束 / how a game ends

🎮 Play It First! — 先玩一玩!

🇨🇳 中文

这就是我们今天要做的游戏!先玩一玩,看它怎么工作。然后我们一步一步在 Scratch 里做出来。

👆 点绿色按钮开始,然后 使劲点饼干!金色饼干 ✨ 值 5 分!

🇬🇧 English

This is the game we'll make today! Play it first to see how it works. Then we'll build it step by step in Scratch.

👆 Click the green button to start, then click the cookie fast! A golden cookie ✨ is worth 5 points!

SCORE 分数
0
TIME 时间
15
Best score 最高分: 0

💡 How does it work? — 它是怎么动的?

每次你点饼干,score(分数)就 +1。time(时间)每秒 −1。时间到 0,游戏就结束。这两个会变的数字,英语叫 variables(变量)。

Each click adds +1 to the score. The time goes −1 every second. At 0, the game ends. Those changing numbers are called variables.

📦 What is a Variable? — 什么是变量?

🇨🇳 中文

一个 变量(variable)就像一个 小盒子 📦,里面放一个数字。盒子上写着名字,比如 score(分数)。

你可以随时打开盒子,把里面的数字 变大 或 变小。游戏里的分数、生命、时间,全都是变量!

🇬🇧 English

A variable is like a little box 📦 that holds a number. The box has a name, like score.

You can open the box any time and make the number bigger or smaller. Score, lives, and time in a game are all variables!

1

Make a variable — 做一个变量

在 橙色 的 Variables 类别里,点 Make a Variable(建立一个变量),起名字叫 score。

In the orange Variables category, click Make a Variable and name it score.

2

These are the variable blocks — 这些是变量积木

set to
change by

set ... to 0 = 把盒子里的数字 设成 0(清零)。
change ... by 1 = 把数字 加 1。change by -1 就是 减 1。

🍪 Build the Cookie Clicker — 动手做点饼干游戏

🇨🇳 中文

打开 scratch.mit.edu,点 Create。我们开始做游戏!

🇬🇧 English

Open scratch.mit.edu and click Create. Let's build the game!

1

Add a Cookie sprite — 加一个饼干角色

删掉小猫(或者留着当帮手)。点右下角 Choose a Sprite,找一个 食物 🍪 当饼干。再选一个漂亮的 backdrop(背景)。

Click Choose a Sprite and pick a food like a cookie 🍪. Then choose a fun backdrop.

2

Start the game: set score to 0 — 开始时分数清零

点 饼干,加这些积木:

▶ when 🚩 clicked
set to

点绿旗的时候,分数从 0 开始。/ When the flag is clicked, score starts at 0.

3

The magic block: when this sprite clicked — 神奇的积木:当角色被点击

这是 全新的 黄色 Events 积木!在 饼干 上加:

▶ when this sprite clicked
change by
start sound

意思:每次 click 饼干 → 分数 +1,再发出 "pop" 的声音。
Each time you click the cookie → score +1, and play a "pop" sound.

4

Make the cookie squish — 让饼干"压一下"

好玩的小动画!在上面那串积木后面再加 紫色 的 Looks 积木:

▶ when this sprite clicked
change by
change size by
wait seconds
change size by

饼干变小一点点,等 0.1 秒,再变回来 — 看起来像被你"压"了一下!/ The cookie shrinks, waits, then grows back — it looks like you squished it!

🎉 你的游戏可以点了!— Your game can be clicked!

点绿旗 🚩,再点饼干。看分数往上加!现在加一个倒计时让它更刺激 👇
Click the flag, then the cookie. Watch the score go up! Now add a timer below 👇

⏱ Add a Countdown Timer — 加一个倒计时

🇨🇳 中文

没有时间限制的游戏不刺激!我们再做一个变量叫 time(时间),从 15 开始,每秒减 1。到 0 就 game over。

🇬🇧 English

A game with no time limit isn't exciting! We'll make a variable called time, start it at 15, and take away 1 each second. At 0, it's game over.

1

Make a "time" variable — 做一个 time 变量

和刚才一样,Make a Variable,名字叫 time。

2

Count down with repeat — 用 repeat 倒数

点 背景(Stage)或饼干,加这串积木。橙色 的 repeat 15 会 重复 15 次:

▶ when 🚩 clicked
set to
repeat
   wait seconds
   change by
end

意思:时间设成 15,然后重复 15 次:等 1 秒,时间 −1。/ Set time to 15, then 15 times: wait 1 second, time −1.

3

Game over! — 游戏结束!

倒数完了(repeat 结束后),加这两块说出最后的分数,然后停下所有积木:

say for seconds
stop

stop all = 停下整个游戏,不能再点了。/ stop all freezes the whole game so you can't click anymore.

🧪 Try it! — 试一试!

点绿旗 🚩 → 时间从 15 开始倒数 → 你拼命点饼干 → 时间到 0 → 看你的最后分数!
Click the flag → the timer counts down from 15 → click like crazy → at 0, see your final score!

👆 上面那个游戏就是这样做的 — 回去玩玩看!/ The game at the top works exactly like this — scroll up and play it!

✨ Make it Even Better — 让游戏更好玩

🇨🇳 中文

真正的程序员会一直让游戏更好玩。试试这些点子,每一个都很简单!

🇬🇧 English

Real programmers keep making their game better. Try these ideas — each one is easy!

✨ Golden Cookie
金色饼干
用 pick random 1 to 10。如果 = 1,change score by 5 并变金色!
Use pick random. If it's 1, score +5 and turn gold!
🔊 Yummy Sound
好吃的声音
点饼干时播放 Chomp 或 Pop 声音。
Play a Chomp or Pop sound on each click.
🐱 Cheering Cat
加油的小猫
加回小猫,时间到时让它说 "Wow!"。
Add the cat back; have it say "Wow!" at game over.
🏆 High Score
最高分
做一个 best 变量。if score > best 就 set best to score。
Make a best variable and save your top score.
⏱ Harder Mode
更难的模式
把 time 改成 10 秒,更刺激!
Change time to 10 seconds for a challenge!
💣 Bad Cookie
坏饼干
加一个会 change score by -3 的坏饼干,别点到它!
Add a bad cookie that takes away points — don't click it!

🌟 这就是真正的编程!— This is real programming!

开始很简单,然后一点一点加新东西。每加一个,你的游戏都更厉害!
Start simple, then add one new thing at a time. Each one makes your game cooler!

🎬 Bonus: A Cartoon Story — 加映:一个卡通小故事

🇨🇳 中文

Scratch 还能讲故事!这个卡通的套路和 《喜羊羊与灰太狼》、《熊出没》 一样 —— 一只饿坏了的大坏蛋想吃掉聪明的小动物,结果被耍得团团转,最后举着拳头喊那句经典台词:"我一定会回来的!"

故事在清迈的河边:老虎想吃掉小mouse-deer卡迪。卡迪指着河里的月亮说"看,一个大年糕!",贪吃的老虎扑进河里 —— 扑通!全身湿透。卡迪笑着挥手拜拜。身体小,脑筋灵!

🇬🇧 English

Scratch can tell stories too! This cartoon borrows the framework of China's favourite cartoons (Pleasant Goat & Big Big Wolf, Boonie Bears): a hungry villain schemes to eat clever little prey, gets outwitted, and shakes his fist — "I'll be back!"

The story: by a Chiang Mai river, a tiger wants to eat Kati the mouse-deer. Kati points at the moon's reflection — "Look, a giant rice cake!" The greedy tiger leaps in… SPLASH! Soaked. Kati waves goodbye. Small but clever!

🐯 💦 🦌 🌙

Kati the Clever Mouse-deer — 聪明的小鼷鹿卡迪

A hungry tiger meets a clever mouse-deer by a Chiang Mai river. Who wins? Watch and see!
清迈河边,饿老虎遇上聪明的小鼷鹿。谁赢?看了就知道!
🎵🔊 With music & spoken Chinese! 有音乐,还会念中文!

⬇ Download .sb3 / 下载故事
★

The story trick: broadcast and wait — 讲故事的秘密:broadcast and wait

一个故事有很多场景,要一个接一个地演。"broadcast … and wait"(广播并等待)就像director喊"开始!",等这个场景演完,再喊下一个。这样角色们就会轮流说话、行动。

▶ when 🚩 clicked
broadcast and wait
broadcast and wait
broadcast and wait
broadcast and wait

每个角色用 when I receive … 接住自己的场景。老虎落水时还换造型(next costume:干 → 湿),角色用 glide 滑进滑出 —— 一个真正的小故事!
Each sprite catches its scene with when I receive …. The tiger changes costume (dry → wet) when he falls in, and characters glide on and off — a real little story!

🎵

The music: play note … for … beats — 音乐:play note … for … beats

音乐是用 Music(音乐)积木做的 —— 不是录音!一段 marimba(木琴)小调一直循环,老虎落水时有 play drum 的cymbal声 💥,卡迪指月亮时有"叮叮"的高音 ✨。你可以改音符,做自己的曲子!

▶ when 🚩 clicked
set instrument to
set tempo to
forever
   play note for beats
   play note for beats
end

这些绿色积木在 Music 扩展里 —— 点左下角 Add Extension(添加扩展)→ Music 就能用。旋律在背景(Stage)上循环,所以整个故事都有配乐。
The green blocks are the Music extension — add it from the Add Extension button (bottom-left). The melody loops on the Stage, so it plays under the whole story.

🔊 角色还会用 Text to Speech(文字转语音)扩展念出中文:先 set language to 中文 (Chinese),再用 speak [中文] 积木。老虎是低沉的 giant 嗓音,卡迪是尖尖的 squeak 嗓音!
The characters also speak the Chinese aloud with the Text to Speech extension: set language to Chinese, then use speak [中文]. The tiger gets a deep giant voice, Kati a high squeak voice — so each line is read out for listening practice!

📂 How to open it — 怎么打开

1️⃣ 打开 scratch.mit.edu → Create。2️⃣ File 文件 → Load from your computer 从电脑上传。3️⃣ 选 cartoon_clever_mousedeer.sb3。4️⃣ 点绿旗 🚩 看故事!
Open scratch.mit.edu → Create → File → Load from your computer → pick the file → click the green flag 🚩 to watch the story!

📚 New English Words — 新的英语单词

🇨🇳 中文

做点饼干游戏时常用的英语词。点单词听发音!🔊

🇬🇧 English

English words you use when making a clicker game. Click any word to hear it!

variable 📦
变量(biàn liàng)
A box that holds a number that can change.
装数字的小盒子,数字会变。
score 🏆
分数(fēn shù)
Points you get in a game.
玩游戏得到的分。
click 👆
点击(diǎn jī)
To press something with your mouse.
用鼠标按一下。
time ⏱
时间(shí jiān)
How many seconds are left.
还剩多少秒。
countdown 🔟
倒计时(dào jì shí)
Counting down: 3… 2… 1… go!
倒着数:3、2、1,开始!
repeat 🔁
重复(chóng fù)
Do something a set number of times.
做几次同样的事。
change ➕
改变(gǎi biàn)
Make a number bigger or smaller.
把数字变大或变小。
set 🎯
设置(shè zhì)
Put an exact number in the box.
把盒子里的数字定成某个值。
stop 🛑
停止(tíng zhǐ)
Make everything halt.
让所有东西停下来。
random 🎲
随机(suí jī)
A surprise number you can't guess.
猜不到的、随便的数字。
backdrop 🖼
背景(bèi jǐng)
The picture behind the sprites.
角色后面的图片。
game over 🏁
游戏结束(yóu xì jié shù)
The game has finished.
游戏玩完了。