Home >Software Tutorial >Computer Software >Tutorial on how to use Scratch query module to achieve dialogue effects using Scratch
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.
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.
3. Human-computer interaction, start the guessing number game
Idea: The computer asks [guess what the number is? 】Players can enter numbers to answer.
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. 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. 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!