1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Scratch】定義ブロックで一文字ずつしゃべるプログラムを作ろう!

Posted at

この記事では、定義ブロックで一文字ずつしゃべるプログラムを作っていきます。
この記事は、Scratch中級者向けです。
定義ブロックの基本的な機能は、Scratchwikiを参照してください。

#一文字ずつしゃべるプログラム
RPGの文字表示のような、「テテテテ・・・」というプログラムを
「〇〇と言う」ブロックでスプライトに喋らせるようにします。
まず、変数を2つ作ります。(下の図参照)

変数

下のような定義も作ります。

定義

では、実際にプログラムを組んでみましょう。
Screenshot 2021-05-21 09.24.11.png
大事なのは、「(表示内容の長さ)回繰り返す」の中です。
一つだけ演算をたくさん使っているブロックがあります。
その役割を簡単に言うと、「表示内容」という変数を「あ」から「あい」に書き換えるというものです。そう考えてみると、以外に簡単に理解できます。
なお、1文字あたり何秒待つか・プログラム中で鳴らす音などは、自分の好みに合わせて決めてください。
#最後に
自分好みのものに作り変えて、プロジェクトに使ってみましょう!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?