Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

Transcript

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 an interviewer’s question. This add-on will show you how to have the user give the answer to an interviewer question. To start, select the interviewer sprite. From the “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 response into a text box. Click on the “ask” block to see what it does. A box shows up at the bottom of the stage. Type some text in the box, then press enter. The variable named “answer” now has the value of what you typed. To see what is stored in the “answer” variable, click the checkbox next to “answer.” You’ll see the answer you just typed. Use this ask/answer pair to ask an interview question and have the user type an answer. Place the “ask” block at the end of the interviewer 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 this club?” Run the code. The interviewer asks the question, then the box for the answer shows up. Any code blocks after the "ask" block won’t run until the user types an answer and presses enter. Next, let the athlete sprite know when the user has finished typing the answer using a “broadcast” block.

From the “events” menu, place a “broadcast” block under the “ask” block. Open the dropdown 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 answer the user gave to the interview question. Select the athlete. From the “events” menu, drag out 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 an answer, press enter, and the athlete says the answer you typed. Cool.

Alright, here’s the gameplan: Add an “ask” block with a new question to the interviewer’s script. Put a “broadcast” block with a new message below the “ask” block. Make the athlete say the user’s typed answer when it receives the broadcasted message.

Scegli un’estensione
Tema caldo
Fai in modo che l'utente risponda alle domande dell'intervistatore.
Momento clou
Mostra le mosse più spettacolari dell'atleta durante la partita.
Frasi bizzarre
Ordina all'atleta di pronunciare frasi a caso.
Disturbatore televisivo (Sfida)
Fai irrompere uno sprite sul palco interrompendo l'intervista.
Pioggia di Gatorade (Sfida)
Versa il Gatorade in testa all'atleta.
Ti scatto una foto
Inserisci una folla di fan che scattano foto al vincitore.
arrow_backward Indietro
Avanti arrow_forward
Istruzioni
  1. Fai clic su qualsiasi casella per andare sul video dei componenti aggiuntivi.
  2. Quando hai terminato, torna sulla schermata dei componenti aggiuntivi e prova un altro componente aggiuntivo.