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.
Choose an Add-On
Make the user answer an interview question!
Show off the athlete's coolest move of the game.
Prompt your athlete to say random things!
Program a sprite to pop onto the stage and interrupt the interview.
Gatorade Shower (Challenge)
Dump Gatorade on your athlete's head.
Have fans take pictures of the victorious athlete.