Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Scratch 1.4: Beginner's Guide

You're reading from   Scratch 1.4: Beginner's Guide Learn to program while creating interactive stories, games, and multimedia projects using Scratch

Arrow left icon
Product type Paperback
Published in Jul 2009
Publisher Packt
ISBN-13 9781847196767
Length 264 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Do you have a question?


Now is a logical time to build some audience participation into our game, so we're going to prompt the user for a question via the ask block. After the user types the question, the teller sprite will provide the fortune.

The ability to collect a string of text via the keyboard is new in Scratch 1.4.

Time for action – ask your question

Select the seeker sprite, and let's begin.

  1. From the Control palette, add the when seeker clicked block to the scripts area.

  2. From the Sensing palette, add the ask block to the when seeker clicked block.

  3. Type a question in the ask block. This is the question, the sprite seeker will ask.

  4. Add a broadcast block to the script and select the message fortune.

  5. Click the seeker to display the ask box on the stage.

  6. Type your question, and then either click the check mark on the ask field or press Enter on your keyboard. The teller responds with your fortune.

What just happened?

Let's hope our teller believes in the old mantra, "there are no dumb questions...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image