![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
こんにちは!
「スクラッチしよう!楽しく学ぶプログラミング教室」の担任ラッチです。
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-300x300.png)
スックです。
よろしくね!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回は、ワンちゃんが歩き回りバケツに当たると驚くアニメーション(動画)をプログラミングします。
![](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation23-1.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-300x300.png)
2つの動きがあるんだね。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
このワンちゃんの2つの動きは、たった3つのコスチュームでできるんだ。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんの3つのコスチューム](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation24.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_are-2-300x300.png)
えっ、この3つのコスチュームで2つの動きが できるんだあ!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
そう!
ワンちゃんの歩いている動きのスクリプトは、これです。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんが歩くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation27.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-3-300x300.png)
うん、うん。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ワンちゃんがバケツに当たって驚くスクリプトは、これです。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんが驚くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation28.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_are-3-300x300.png)
あっ、コスチュームがちがうね。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
そう!
「コスチュームを〇にする」ブロックで、
![scratch 「コスチュームを〇にする」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation29.png)
歩くコスチュームと驚くコスチュームを分けることができるんだ。
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-4-300x300.png)
よーし、ぼくもチャレンジしてみよう!
それでは、楽しくプログラミングを学んでいきましょう!
今回作るスクラッチの作品は、これっ!
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-300x300.png)
緑の旗をクリックして、遊んでみてね!
今回のプログラミングで学ぶことは
1.ワンちゃんが歩き回るスクリプトがわかるよ。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんが歩き回る](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei1.png)
2.ワンちゃんがテクテク歩くスクリプトがわかるよ
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんの足が動く](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei2-1.png)
3.バケツをクリックすると落ちるスプリクトがわかるよ
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツをクリックすると落ちる](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei3-1.png)
4.バケツに当たると、ワンちゃんが驚くスクリプトがわかるよ
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツに当たるとワンちゃんが驚くスクリプト](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei4.png)
スクリプトを見てみよう
スプライトはこれです!
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch スプライト](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_sprite.png)
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
このスクラッチ作品のスプライトは、
- 「ワンちゃん」
- 「バケツ」
です。
- 「Dog2」を「ワンちゃん」に名前を変えました。
- 「Bowl」を「バケツ」に名前を変えました。
スクリプトはこれです!
ワンちゃんのスクリプト
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんのスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_script1.png)
バケツのスクリプト
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツのスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_script2.png)
プログラミングの仕方を説明します
ワンちゃんのスクリプト
歩きつづけるプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんが歩きつづけるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation3.png)
姿が さかさまにならないプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんが逆さまにならないスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation7.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/ratch_kao_dounaru-3.png)
スプライトのさかさまをなおす方法に「回転方法を左右のみにする」コードを使いました。
ほかのやり方もあります。
下の記事にくわしく説明してます。
足が動くプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんの足が動くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation10.png)
バケツに当たると 止まっておどろくプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんがバケツに当たると止まって驚くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scrtchsiyoutitle0202_explanation13.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_question-300x300.png)
ラッチ先生。
「スプライトの他のスクリプトを止める」ってなんですか?
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
わかりそうでわからないコードだね!
「すべてを止める」コードの使い方の記事の中で、
この「スプライトの他のスクリプトを止める」コードの、
- 作り方
- 使い方
についてわかりやすく説明しています。
「いたいなあ」と言って 終わるプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんがバケツに当たると「いたいなあ」と言って終わるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation14.png)
バケツのスクリプト
最初の場所を 決めるプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツの最初の位置を決めるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation17.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-300x300.png)
「x座標?」「y座標?」という人は、
こちらの記事で学んでね!
クリックすると落ちて 元の場所に戻るプログラミング
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツをクリックすると落ちて、元に戻るスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation19.png)
![scratch 「y座標を-10ずつ変える」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation20.png)
- y座標が、10ずつ減っていく。(低くなる)
![scratch 「y座標を-10ずつ変える」ブロックの役目](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0202_explanation21.png)
動きによって コスチュームをえらぼう
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_are-300x300.png)
ラッチ先生!
「コスチューム」をえらぼうってどういうこと?
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ワンちゃんのコスチュームを見てみよう。
ワンちゃんのコスチュームは3つありますね。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんの3つのコスチューム](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation24-1.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
3つ目のコスチュームのワンちゃんは、おもしろい顔をしているね。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
そうだね!
コスチュームの「dog2-c」は、おもしろい顔をしていますね。
このコスチューム(絵)をバケツに当たった時のポーズにしようと考えたんだ!
コスチュームを「dog2-c」にするときに使うブロックは、これなんだよ。
![scratch 「コスチュームをdog2-cにする」ブロック](https://scratchsiyou.com/wp-content/uploads/2021/11/0d40a5e4a645fc6b96e767d64ac0878e-41.png)
![scratch 「コスチュームをdog2-cにする」の表示画像](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation30-1.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
このブロックを
![scratch 「コスチュームをdog2-aにする」ブロックの▽をクリックして「dog2-c」にする](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation32.png)
「dog2-a▽」の▽をクリックして「dog2-c」にするんだね!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
そうです。
そして、バケツに当たったらこの顔にするというコードを作るんだ。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツに当たった時、コスチュームdog2-cにするスクリプト](https://scratchsiyou.com/wp-content/uploads/2021/11/0d40a5e4a645fc6b96e767d64ac0878e-44.png)
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch バケツに当たった時のワンちゃん](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation33.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
アハハ!おもしろい!!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
のこりの2つのコスチュームは、
歩いている動きに使えるなと考えました。
![scratch コスチューム「dog2-a」と「dog2-b」](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation34.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
あっ、ほんとだ!
この2つをペラペラ漫画のように歩く動きをつけるんだね!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_yes-300x300.png)
そのとお~~~り!
このスクリプトでワンちゃんが歩く動きをするよ。
![「スクラッチしよう!2-2 歩いているワンちゃんにバケツを当てよう!」scratch ワンちゃんの足が動くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0202_explanation10-1.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
うん、うん。動いたぁ!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回の作品のように
・歩いている時
![](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei1-1.png)
・バケツが当たった時
![](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei4-1.png)
コスチューム(絵)を変えたい時は、この「コスチュームを〇にする」コードを使うといいですよ。
![](https://scratchsiyou.com/wp-content/uploads/2021/11/0d40a5e4a645fc6b96e767d64ac0878e-51.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
はぁーーい!
わかりましたぁーーーー!
まとめ
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回は、
「コスチュームを〇にする」ブロックを使って、
ワンちゃんが歩き回り、バケツに当たったら驚くアニメーション(動画)のプログラミングを学びました。
今回のプログラミングでわかったこと
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「コスチュームを〇にする」ブロックを使って、コスチュームを変えると、
・ワンちゃんが歩いたり、
![](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei5.png)
・ワンちゃんがおどろいたり、
![](https://scratchsiyou.com/wp-content/uploads/2021/11/scratchsiyoutitle0202_setumei6.png)
動きを 変えることができるんだ!
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
そうだね!
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
みなさんも、作品を作るときに、
まず、スプライトにどんなコスチュームがあるか見てみよう!
スプライトにおもしろく動かせることができるようになるよ!
それじゃあ、また!!
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_futu-300x300.png)
まったねえーーー!
(@^^)/~~~
ステップアップドリル
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「変数」って、なあに?
「変数」ブロックって、どう使うの?
と 思っている方に!
変数ブロックでのプログラミングを 学べるドリルを 作りました
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「リスト」って、なあに?
「リスト」ブロックって、どう使うの?
と 思っている方はこちら!
リストブロックでのプログラミングを 学べるドリルを 作りました
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_futu-300x300.png)
画面を クリックすると
「ステップアップドリル」のサイトへ 行けます!
コメント