Ask the player a question
Use askAndWait to show an input box on the stage, then read what the player typed with getAnswer.
whenGreenFlag(() => { askAndWait("What is your name?"); say("Hello, " + getAnswer() + "!");});The sprite pauses and waits for the player to type and press Enter. Once they do, getAnswer returns whatever they typed so you can use it anywhere.
Functions used
Section titled โFunctions usedโwhenGreenFlagโ run code when the green flag is clickedaskAndWaitโ show an input prompt and wait for the playerโs answergetAnswerโ get the most recent answer from askAndWaitsayโ show a speech bubblemoveโ move forward by a number of steps