Home >Software Tutorial >Computer Software >Tutorial on how to use Scratch query module to achieve dialogue effects using Scratch

Tutorial on how to use Scratch query module to achieve dialogue effects using Scratch

WBOY
WBOYforward
2024-05-06 10:10:18443browse

Want to make Scratch characters have conversations, but don’t know how to do it? Don't worry, PHP editor Xinyi brings you a Scratch query module tutorial. It will teach you step by step how to use the query module to create dynamic dialogues and make your Scratch projects more lively and interesting. Come and find out!

1. The computer outputs the game rules and is ready to start the game!

Idea: The kitten character acts as the host and announces the rules of the game through the [Say xxx for a few seconds] module in the appearance.

Scratch询问模块怎么用 Scratch实现对话效果的教程

2. Add a variable [random number],

Idea: Design a range of numbers, and let the computer select random numbers in this range. After completing the following procedures, when After we click the green flag, we will find that random numbers between 1 and 10 begin to appear in the variable box in the upper left corner of the stage.

Scratch询问模块怎么用 Scratch实现对话效果的教程 Scratch询问模块怎么用 Scratch实现对话效果的教程 Scratch询问模块怎么用 Scratch实现对话效果的教程

3. Human-computer interaction, start the guessing number game

Idea: The computer asks [guess what the number is? 】Players can enter numbers to answer.

Scratch询问模块怎么用 Scratch实现对话效果的教程

4. Determine whether the guess result is correct

Idea:

answer>random number, then the output guess is too large and the game continues

Answer

Answer = random number, then the output guess is correct, congratulations.

Scratch询问模块怎么用 Scratch实现对话效果的教程 Scratch询问模块怎么用 Scratch实现对话效果的教程

5. The basic program has been completed. There is still a small step to make the game more interesting, which is to hide the random number variables. Otherwise, there will be Digital reminders directly expose the answers.

Scratch询问模块怎么用 Scratch实现对话效果的教程

6. Game time: Next, you can start the guessing number game.

The above is the detailed content of Tutorial on how to use Scratch query module to achieve dialogue effects using Scratch. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zol.com.cn. If there is any infringement, please contact admin@php.cn delete