![ラッチ先生](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)
シューティングゲームを作ります。
的は、上から落ちてくる雪です。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch ゆきをねらうシューティングゲーム](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation49.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-10-300x300.png)
シューティングゲームだ!
うれしい。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
星に当たると、雪が破裂します。
そのプログラミングが、これです!
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 雪が破裂するスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation18.jpg)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-10-300x300.png)
破裂の仕方が、かっこいい。
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回は、
・「渦巻きの効果を〇ずつ変える」ブロック
![scratch 「渦巻きの効果を〇ずつ変える」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation50.png)
を使って、
雪が破裂するシューティングゲームをプログラミングしていきましょう。
![スック](https://scratchsiyou.com/wp-content/uploads/2021/11/sukku_futu-10-300x300.png)
よぉーし、やるぞぉ!
楽しくプログラミングを学んでいきましょう!
今回作るスクラッチの作品は、これっ!
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_ok-300x300.png)
遊んでみよう!
今回のプログラミングで学ぶことは
1.やじるしが 0度から90度の間を動くスクリプトがわかるよ
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch やじるしが0~90度の間を動く](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_explanation2-1.png)
2.やじるしをクリックすると 星が飛び出すスクリプトがわかるよ
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch やじるしをクリックすると星が飛び出す](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation2-1.png)
3.雪が 落ちてくるスクリプトがわかるよ。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 雪が上から落ちてくる](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation3.png)
4.星に 当たると 雪が はれつするスクリプトがわかるよ
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 矢印に当たると雪がはれつする](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation4-1.png)
スクリプトを見てみよう
スプライトはこれです!
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch スプライト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_splite.png)
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
このスクラッチ作品のスプライトは、
- 「やじるし」
- 「星」
- 「ゆき」
です。
- 「Arrow1」を「やじるし」に名前を変えました。
- 「Star」を「星」、大きさを「50」にしました。
- 「Snowflake」を「ゆき」、大きさを「20」にしました。
スクリプトはこれです!
やじるしのスクリプト
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch やじるしのスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_script1-.png)
星のスクリプト
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 星のスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_script2-1-1.png)
ゆきのスクリプト
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 雪のスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_script3.png)
プログラミングの仕方を説明します
やじるしのスクリプト
最初の場所を決めるプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」scratch やじるしの最初の場所を決めるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_script4.png)
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「X座標」「y座標」は、
スプライト(ここでは「やじるし」です)の場所をあらわす言葉
です。
これについて、知りたい方はこちらの記事を読んでみよう!
0~90度の間を 動くプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch やじるしが0~90度の間を動くスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation22.png)
ほしのスクリプト
クリックすると 矢印から現れるプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 矢印をクリックすると星が現れるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation8.png)
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
ここで、「発射を送る」「発射を受け取ったとき」ブロックを使います。
この「メッセージを送る」ブロックの使い方をよく知りたい方は、こちらで学べます。
![「スクラッチしよう!2-7 こうもりを うちおとせ!」 scratch 「やじるしのx座標」「やじるしのy座標」ブロック](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_script11-800x81.png)
![「スクラッチしよう!2-7 こうもりを うちおとせ!」 scratch 「やじるしの向き」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_code2.png)
1.「調べる」から「ステージの背景#」ブロックを取り出す。
![scratch 「調べる」タブから「ステージの背景#」ブロックを取り出す](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_explanation10.png)
2,「ステージ▽」をクリックして、「やじるし」にする
![scratch 「ステージの背景#」ブロックの▽をクリックして「やじすし」をクリックする](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_explanation12.png)
3,「やじるしのx座標」ブロック 完成!
![scratch 「やじるしのx座標」ブロック完成](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_script9-1.png)
4,「x座標▽」をクリックして、「y座標」にする
![scratch 「やじるしのx座標」の「x座標」▽をクリックして、「y座標」にする](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_explanation14.png)
5,「やじるしのy座標」ブロック 完成
![scratch 「やじるしのy座標」ブロック完成](https://scratchsiyou.com/wp-content/uploads/2021/12/scratchsiyoutitle0207_script10-1.png)
6,「y座標▽」をクリックして、「向き」にする。
![scratch 「やじるしのy座標」の「y座標」▽をクリックして、「向き」にする](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation9.png)
7,「やじるしの向き」ブロック 完成
![scratch 「やじるしの向き」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_code2-1.png)
クリックすると 星が飛び出すプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 矢印をクリックすると星が飛び出すスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation23.png)
端に当たると もとにもどり消えるプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 矢印が端に当たると元の場所に戻り隠れるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation24.png)
ゆきのスクリプト
最初の場所を 決めるプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 雪の最初の場所を決めるスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation26.png)
下に落ちて 元の場所に戻るプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 雪が下に落ちて元の場所に戻るスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation29.png)
星に当たると はれつするプログラミング
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 星に当たると雪がはれつするスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation32.jpg)
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_ok-300x300.png)
・「渦巻きの効果」
・「色の効果」
・「大きさ」
・「幽霊の効果」ブロックを使ってるね!
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回のプログラミングは、前に学んだことを組み合わせています。
かっこいい雪のはれつになっているでしょう!
「色の効果」「大きさ」「幽霊の効果」のブロックについて知りたい方は、
こちらを読んでみてね。
「渦巻きの効果を〇にする」ブロック
使い方
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_question-300x300.png)
「渦巻きの効果」って、どうなるの?
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「渦巻きの効果」ブロックは、
スプライトの姿を渦巻のようにねじります。
![scratch 「渦巻きの効果を〇にする」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_code1-5-1.png)
- スプライトの姿を渦巻のように左回りにねじる(プラス)
![scratch 「渦巻きの効果を〇にする」ブロックの役目(プラス)](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanarion19.png)
![スック](https://scratchsiyou.com/wp-content/uploads/2021/12/sukku_are-300x300.png)
渦巻きの効果をマイナスにできるの?
![ラッチ先生<br>](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_yes-300x300.png)
できますよ。
渦巻きの効果をマイナスにすると反対にぐるぐるぅ~~~と・・・。
- スプライトの姿を渦巻のように右回りにねじる(マイナス)
![scratch 「渦巻きの効果を〇にする」ブロックの役目(マイナス)](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation20.png)
作り方
![scratch 「渦巻きの効果を〇にする」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_code1-5-2.png)
1,「見た目」の「色の効果を〇ずつ変える」ブロックを取り出す。
![scratch 「見た目」タブから「色の効果を〇ずつ変える」ブロックを取り出す](https://scratchsiyou.com/wp-content/uploads/2021/12/0d40a5e4a645fc6b96e767d64ac0878e-9.png)
2,「色の効果を0ずつ変える」ブロックの「▽」をクリックする。
![scratch 「色の効果を〇ずつ変える」ブロックの▽をクリック](https://scratchsiyou.com/wp-content/uploads/2022/03/scracthsiyoutitle0206_code19.png)
3,「渦巻き」をクリックする
![scratch 「渦巻き」をクリックする](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_explanation21.png)
4,「渦巻きの効果を〇にする」ブロック 完成
![scratch 「渦巻きの効果を〇にする」ブロック完成](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_code1-5-1.png)
![scratch 「渦巻きの効果を〇ずつ変える」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/01/scratchsiyoutitle0209_code3-5.png)
スプライトを もとの姿に戻る
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
「画像効果をなくす」ブロックで、
破裂した雪を、元の姿に戻してゲームを再開します。
![scratch 「画像効果をなくす」ブロック](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0208_explanation23-2.png)
- スプライトの姿を元にもどす
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 破裂した雪を元に戻すスクリプト](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation32.jpg)
雪をきれいに 破裂させるプログラミング
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
雪をきれいに破裂させるプログラミングだよ!
「渦巻きの効果」ブロックに、他の効果を追加していく。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 「渦巻きの効果」ブロックだけの雪のはれつ](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation37png-800x583-1.png)
「色の効果を2ずつ変える」ブロックを追加。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 「渦巻きの効果」と「色の効果」ブロックの雪のはれつ](https://scratchsiyou.com/wp-content/uploads/2022/03/scratchsiyoutitle0209_explanation41.-1-800x583-1.png)
「大きさを10ずつ変える」コードを追加。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 「渦巻きの効果」と「色の効果」と「大きさ」ブロックの雪のはれつ](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation45.jpg)
「幽霊の 効果を1ずつ 変える」コードを追加。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 「渦巻きの効果」と「色の効果」と「大きさ」と「幽霊」ブロックの雪のはれつ](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation48.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)
うん、すごくよくなってるよ!
まとめ
![ラッチ先生](https://scratchsiyou.com/wp-content/uploads/2021/12/ratch_kao_dounaru.png)
今回は、
「渦巻きの効果」ブロックを使って、スプライトの姿を渦巻きのようにぐるぐるまわす
プログラミングを学びました。
![「スクラッチしよう!2-9 渦巻き効果で雪をはれつさせよう!」 scratch 「渦巻きの効果」と「色の効果」と「大きさ」と「幽霊」ブロックの雪のはれつ](https://scratchsiyou.com/wp-content/uploads/2022/02/scratchsiyoutitle0209_explanation48.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)
みんなも見た目の効果のブロックを変えたり、追加してみましょう。
自分の気に入った雪の破裂ができあがりますよ!
それじゃ、また!
![スック](https://scratchsiyou.com/wp-content/uploads/2022/01/sukku_ok-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)
画面を クリックすると
「ステップアップドリル」のサイトへ 行けます!
コメント