![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
こんにちは!
「ステップアップドリル:変数ブロックの使い方入門」に ようこそ!
「スクラッチしよう!楽しく学ぶプログラミング教室」の担任ラッチです。
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_futu-300x300.png)
スックだよ!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回の「ステップアップドリル」で作る作品は、こちら!
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif2.gif)
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_futu-300x300.png)
ケーキを ゲットしたら、クリアだよ!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ねっちを捕まえる ロボの動く速さが ランダム。
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ロボの動き](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif4.gif)
ローカル変数「数字」ブロックが 使われているんだ
![変数ブロック](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation1.png)
![変数表示](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation3.png)
![このスプライトのみ](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation2.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2023/09/sukku_are-300x300.png)
あっ!
ロボの 動きの速さが ちがう
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
はい!
それでは、ローカル変数が どのように使われているか 学んでいこう
![スック](https://scratchsiyou.com/wp-content/uploads/2023/09/sukku_ok-300x300.png)
いいよ!
今回作るスクラッチの作品は、これっ!
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif5.gif)
![スック](https://scratchsiyou.com/wp-content/uploads/2023/07/sukku_futu-1-300x300.png)
ケーキは しばらくすると
違う場所に うつるよ
今回のプログラミングで 学ぶことは
1.ねっちが近づいたら ロボが現れる スクリプトが わかるよ
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ねっちが近づくと現れる](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif7.gif)
2.ロボの 追いかける速さが ランダムになる スクリプトが わかるよ
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch 追いかける速さはランダム](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif9.gif)
3.ロボに捕まると ゲームオーバーになる スクリプトが わかるよ
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ゲームオーバー](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif11.gif)
4.ねっちから 遠くに ケーキが現れる スクリプトが わかるよ
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ケーキが遠くに現れる](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif13.gif)
プログラミングの仕方を説明します
ねっちが 近づくと現れるプログラミング
1.ねっちが近づいたら ロボが現れる スクリプトが わかるよ
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ねっちが近づくと現れる](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif7.gif)
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
最初に、スプライト「ねっち」を 作ります
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch スプライト「ねっち」](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation4-800x548.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2023/01/sukku_futu-300x300.png)
スプライト「ねっち」の作り方は、
こちらの動画にあります
大きさは、「80」だよ!
フリーBGM:DOVA-SYNDROME 午後のカメレオンは星の波動を数え… written by Masuo
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
それでは、スプライト「ねっち」の
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch スプライト「ねっち」](https://scratchsiyou.com/wp-content/uploads/2023/04/scratchdrill01-planation13.png)
プログラムを 作りましょう。
![スック](https://scratchsiyou.com/wp-content/uploads/2022/10/sukku_futu-300x300.png)
はぁ~い!
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「○へ向ける」ブロックを 使って
![「○へ向ける」ブロック](https://scratchsiyou.com/wp-content/uploads/2023/04/scratchdrill01-planation14.png)
ねっちを マウスで動かす プログラムを作ります
1.ねっちを マウスで 動かす
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch マウスで動かすスクリプト](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif15.gif)
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
つぎは、
新しくスプライト「ロボ」を
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch スプライト「ロボ」追加](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation6-800x557.png)
追加します。
![スック](https://scratchsiyou.com/wp-content/uploads/2022/10/sukku_futu-300x300.png)
スプライト「Frank」を 追加
名前を 「ロボ」に したよ!
大きさは、「30」です
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ロボの
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch スプライト「ロボ」](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation7.png)
プログラムを 作っていくよ。
![スック](https://scratchsiyou.com/wp-content/uploads/2022/10/sukku_futu-300x300.png)
O.K!
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「○のクローンを作る」ブロックを 使って
![「○のクローンを作る」ブロック](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation8.png)
ロボを 3体 表示させよう
1.ロボを 3体 表示する
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch 3体のロボを表示するスクリプト](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif17.gif)
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ロボの現れ方を ちょっと工夫してみよう。
「幽霊の効果を○ずつ変える」ブロックと
![「幽霊の効果を○ずつ変える」ブロック](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation10.png)
![](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif20.gif)
「ピクセル化の効果を○ずつ変える」ブロックを 使って
![「ピクセル化の効果を○ずつ変える」ブロック](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation11.png)
![](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif21.gif)
ロボの出現を プログラムしよう
![スック](https://scratchsiyou.com/wp-content/uploads/2023/09/sukku_are-300x300.png)
あらっ、ロボの形が なくなっちゃった…
2,ロボを だんだんと出現させる
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch 3体のロボを表示するスクリプト②](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif23.gif)
![スック](https://scratchsiyou.com/wp-content/uploads/2023/09/sukku_futu-300x300.png)
「幽霊の効果を○にする」ブロックで
![「幽霊の効果を○にする」ブロック](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-explanation13-1.png)
![](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif25.gif)
はじめは ロボを 透明にしたよ。
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
もうちょっと、ロボの現れ方を 工夫するね。
ねっちが 近づいてきたら ロボが 現れるようにしてみるよ。
![「スクラッチしよう!8-1-02 ステップアップドリル:ねっち おにごっこ!」 scratch ねっちが近づくと現れる](https://scratchsiyou.com/wp-content/uploads/2023/09/scratchdrillocal02-gif27.gif)
![スック](https://scratchsiyou.com/wp-content/uploads/2023/09/sukku_are-300x300.png)
あっ!どうなってんだぁ?
コメント