After the first video, you wrote scripted responses to planned interview questions.
Sometimes, though, an athlete might not have something planned to say in response to aninterviewer’s question. This add-on will show you how to have the user give the answerto an interviewer question. To start, select the interviewer sprite. Fromthe “sensing” menu, drag out an “ask” block. The “ask” block works like the“say” block, but rather than simply saying words, it also allows a user to type a responseinto a text box. Click on the “ask” block to see what itdoes. A box shows up at the bottom of the stage. Type some text in the box, then pressenter. The variable named “answer” now has the value of what you typed. To see whatis stored in the “answer” variable, click the checkbox next to “answer.” You’llsee the answer you just typed. Use this ask/answer pair to ask an interviewquestion and have the user type an answer. Place the “ask” block at the end of theinterviewer sprite’s code stack. Type a question into the blank in the “ask” block.
In this example, the interviewer sprite asks, “What contributed to your success in thisclub?” Run the code. The interviewer asks the question, then the box for the answershows up. Any code blocks after the "ask" block won’t run until the user types ananswer and presses enter. Next, let the athlete sprite know when theuser has finished typing the answer using a “broadcast” block.
From the “events” menu, place a “broadcast” block under the “ask” block. Open thedropdown and click “new message.” Name the message something that makes sense, like“answer the question,” then click “OK.” Now, have the athlete sprite repeat the answerthe user gave to the interview question. Select the athlete. From the “events” menu, dragout a “when I receive” block. From the dropdown, select the message you created.
Under this block, make the sprite say the answer that the user typed. From the “looks”menu, place a “say” block under the “when I receive” block. From the “sensing”menu, place “answer” inside the “say” block.
Test the code. The interviewer asks the question, and a box pops up on the stage. You type ananswer, press enter, and the athlete says the answer you typed. Cool.
Alright, here’s the gameplan: Add an “ask” block with a new questionto the interviewer’s script. Put a “broadcast” block with a new messagebelow the “ask” block. Make the athlete say the user’s typed answerwhen it receives the broadcasted message.
Scegli un’estensione
play_circle_filled
Tema caldo
Fai in modo che l'utente risponda alle domande dell'intervistatore.
arrow_forward
play_circle_filled
Momento clou
Mostra le mosse più spettacolari dell'atleta durante la partita.
arrow_forward
play_circle_filled
Frasi bizzarre
Ordina all'atleta di pronunciare frasi a caso.
arrow_forward
play_circle_filled
Disturbatore televisivo (Sfida)
Fai irrompere uno sprite sul palco interrompendo l'intervista.
arrow_forward
play_circle_filled
Pioggia di Gatorade (Sfida)
Versa il Gatorade in testa all'atleta.
arrow_forward
play_circle_filled
Ti scatto una foto
Inserisci una folla di fan che scattano foto al vincitore.