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
Free Learning
Arrow right icon
Raspberry Pi Projects for Kids (Second Edition)
Raspberry Pi Projects for Kids (Second Edition)

Raspberry Pi Projects for Kids (Second Edition): Leverage the power of programming to use the Raspberry Pi to create awesome games

Arrow left icon
Profile Icon Daniel Leonard Bates
Arrow right icon
€10.99 €16.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (5 Ratings)
eBook Apr 2015 146 pages 1st Edition
eBook
€10.99 €16.99
Paperback
€20.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Daniel Leonard Bates
Arrow right icon
€10.99 €16.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (5 Ratings)
eBook Apr 2015 146 pages 1st Edition
eBook
€10.99 €16.99
Paperback
€20.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€10.99 €16.99
Paperback
€20.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Raspberry Pi Projects for Kids (Second Edition)

Chapter 2. Animating with Scratch

In this chapter, we're going to use a programming language called Scratch to create a simple animation. Along the way, we'll visit many of the main concepts of programming languages, so if you understand everything that you learn in this chapter, you will be well equipped to start writing programs of your own.

Scratch

In this chapter, we will use Scratch to create our animation. Scratch is a programming language that has been specially designed so that you can make animations and games with ease. Version 1.4 of Scratch is pre-installed with the Raspbian OS but is also available on other computers. You can download it from http://scratch.mit.edu/ if you ever want to run your programs away from your Raspberry Pi. Start up Scratch by opening Menu at the top of the screen, and navigating to Programming, and then Scratch.

Tip

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

The following screenshot shows the layout of Scratch:

Scratch

The following are its main sections. I'll mention the names of these sections throughout the next two chapters, so...

Interactive animation

We now have two different animated sprites, each doing their own thing. One of the special features of Scratch is that it makes interactive animation simple—we can program a sprite to react to you!

Create a new sprite in the same way as you did before using the Choose new sprite from file button. For this animation, we're going to have a simple conversation with the user, so choose an image of something that can talk. Find a good position and size for the new sprite, then build the following script in its script area:

Interactive animation

There are a few new code blocks here. Let's go through them one by one:

  • ask and wait: This gives the sprite a speech bubble, asking a question in a box. This block can be found in the Sensing section. The script will stop until the user has typed an answer into a text box on screen.
  • answer: The answer to the question is stored in this block, and is also in the Sensing section.
  • join: This takes two pieces of text and merges them into a longer...

Summary

In this chapter, we explored a few different ways of creating animations in Scratch. Along the way, we used a wide selection of the available code blocks. Many of these blocks are very similar to those used in other programming languages—you will recognize them in later chapters.

Importantly, you should recognize that this is your program, and you are free to change it as you like. You can change the way any of the sprites look, you can change any of the text or numbers, and you can even change which blocks are used to change the behavior of the program.

In the next chapter, we will continue the theme of making things interactive by building an entire game in Scratch – a version of Angry Birds which you will be able to modify to suit you.

Left arrow icon Right arrow icon

Description

This book is for kids who wish to develop games and applications using the Raspberry Pi. No prior experience in programming is necessary; you need only a Raspberry Pi and the required peripherals.

Who is this book for?

This book is for kids who wish to develop games and applications using the Raspberry Pi. No prior experience in programming is necessary

What you will learn

  • Gear up to start programming by setting up the Raspberry Pi and taking a tour of available applications
  • Understand the fundamentals of programming and electronics using the Raspberry Pi
  • Use the Linux operating system and programming languages such as Scratch and Python to build interesting projects
  • Gain a basic understanding of how the Python programming language works by writing simple programs
  • Build a fully functioning game and explore how to modify it to create new levels
  • Create animations and music to make your games and applications more exciting
  • Make computer code interact with the physical world
  • Add markers to your personal mapping program
  • Get an understanding of Sonic Pi, and discover how to use it to create your own music

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 28, 2015
Length: 146 pages
Edition : 1st
Language : English
ISBN-13 : 9781785280436
Vendor :
Raspberry Pi
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 28, 2015
Length: 146 pages
Edition : 1st
Language : English
ISBN-13 : 9781785280436
Vendor :
Raspberry Pi
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 71.97
Raspberry Pi Projects for Kids (Second Edition)
€20.99
Python Projects for Kids
€29.99
JavaScript Projects for Kids
€20.99
Total 71.97 Stars icon
Banner background image

Table of Contents

8 Chapters
1. Getting Started with Raspberry Pi Chevron down icon Chevron up icon
2. Animating with Scratch Chevron down icon Chevron up icon
3. Making Your Own Angry Birds Game Chevron down icon Chevron up icon
4. Creating Random Insults Chevron down icon Chevron up icon
5. Testing Your Speed Chevron down icon Chevron up icon
6. Making an Interactive Map of your City Chevron down icon Chevron up icon
7. Building Beats with Sonic Pi Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(5 Ratings)
5 star 60%
4 star 20%
3 star 20%
2 star 0%
1 star 0%
Amazon Customer Oct 10, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
[Disclaimer & Explanation] I reviewed this book in MagPi magazine #35 - appreciating its concise and concentrated introduction to programming via the Pi, and recommend it for confident learners - or those with a knowledgable parent to call upon for occasional help. The review is reproduced below (like all of MagPi, it's available under CC-by-SA terms)."The Raspberry Pi exposes programming software to make it as easy as possible to get started," says Bates in his preface. After a chapter on getting set up with the Pi, the book launches into trying out programming through six mini projects, starting with the excellent Scratch visual programming language: first to do some animation, with programming concepts – and the power and freedom of programming – introduced as a natural part of learning the animation procedure; then an Angry Birds clone, that includes physics (gravity and bouncing), scoring, and a chance to add in your own extensions.Python is next, with a random insults generator - always a popular bit of fun - which introduces list handling and functions. Then a connection to the physical world: first through an excellent DIY game controller for a speed test game, then with Google maps and tkinter to look at your neighbourhood. Lastly, an introduction to music making with software, through SonicPi.All in all this software focussed introduction gives a quicker starting path than many of the more maker-oriented Pi books, which themselves would make an ideal follow on. After working through Bates's readable and friendly guide, any child will know a surprisingly large amount of core programming skills, as well as a thirst for more. Recommended.
Amazon Verified review Amazon
Eagleeye Jul 11, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
good book
Amazon Verified review Amazon
Jaume Aragay Badia Oct 08, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book begins with the installation process of the operating system on the memory card and also a list of the most common difficulties and their solution. On all the chapters the text offers the basic information needed but also links external references for extra information on the topics covered.After the Raspberry Pi is working properly, we meet Scratch, a graphic language that allows you to make your first programs assembling graphic blocks like with LEGO. This way you don't have to care about writing code properly. There is no code to write, you just assemble the orders to form a program. With Scratch you begin with simple animations and after that you make your own Angry Birds Game.On the next chapter you use Python. Python is a language with an easy syntax that has much more possibilities that Scratch. You will use structures like IF-ELSE to make branches in your programs to reach new heights in your programming skills. Then you use a physical controller to interact with the Raspberry Pi board to broaden even more the possibilities.After that you interact with external resources like Google Maps to make an interactive map of your city.The last chapter moves in a different direction to use Sound in the Raspberry Pi to see new opportunities.As I said before, this book is great for introduction to the possibilities of the Raspberry Pi board and also offers branches to new sources of information to broaden the knowledge on the topic. Very clearly written and explained.
Amazon Verified review Amazon
Gopinath Palaniappan Oct 09, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I had a couple of older versions of Raspberry Pi's lying around. I was wondering if I could let my 11yr old tinker with dad's favorite inexpensive SBC. Thanks to +Packt Publishing and +Fahad Siddiqui for some great books to help bootstrap the kid. Here's my review of the books.Raspberry Pi Projects for Kids - Second Edition"Leverage the power of programming to use the Raspberry Pi to create awesome games"Author: Daniel BatesAs the name suggests, its a book for kids. You don't need any prior experience to use the book. Hence its perfect for a kids new to Raspberry Pi. You do need a Raspberry Pi to enjoy all the hardware projects, but I realized after reading the book that it does a decent job introducing kids to Scratch and Python. In fact you don't need the Raspberry Pi for the first 4 chapters. You can learn Scratch and Python programming without it.Here's a rough breakdown of the chapters:* C1 : Includes basic setup of Raspberry Pi, installation of software on Raspberry Pi* C2 : Introduces Scratch programming* C3 : You make your own Angry Birds game in Scratch* C4 : Introduces you to Python* C5 : Make your own game controller and program it using Python* C6 : GUI application, Google maps* C7 : Sonic Pi application to teach musicI let my kid read the book. Since he was already familiar with Scratch, it was easy for him to zip thru till Chapter3. He kind of got lost in the middle of Chapter4. The paradigm shift into a non visual programming language was like a jolt for him. There was nothing to drag and drop. Too many concept to grasp in one sitting.I asked him to skip the chapter to the next. Chapter 5 started of interestingly with building of a game controller with some handy office supplies. My son was exited to create his own version using play-dough and some conducting tape. But he didn't have the patience to work on the code. I jumped in and filled in to get the project working.We skipped Chapter6 as well and moved on to another favorite part of the book, to create music with code. My son goes to Piano classes and recently figured out how to play STAR WARS theme song. He was so exited to code that into Sonic Pi and hear his favorite music play.Over all it was a fun experience. It even included code samples on Packt Publishing website. On the positive side, its exactly what I needed a quick jumpstart for my kid. On the downside, I wish it had a little more hands-on with Raspberry Pi hardware, rather than focus on software alone. The later chapters were also hard for my son to follow along. But thats a good thing..it will be something he can revisit in an year and find it fun to work on.I would highly recommend this book to anyone looking to get your kids jumpstarted on programming or getting introduced to hardware. For $35 Raspberry Pi is an affordable way to let your kid introduced to computers...let them tinker and make mistakes.. thats how they learn and thats how I learned growing up.Link to the books:http://www.amazon.com/dp/1785281526 [$11.99 kindle/$24.99 print]https://www.packtpub.com/hardware-and-creative/raspberry-pi-projects-kids-second-edition [$19.99 ebook/$24.99 print]
Amazon Verified review Amazon
MRL Oct 09, 2015
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
The first chapter of the book follows a tradition of other Pack books about Raspberry Pi and describes the system and how to set it up.In the second chapter, the author introduces the main programming language featured in the book: Scratch.This chapter represents a good introduction to the language and to program a simple animation, while the next one goes deeper on the language, using another game as an example.The fourth chapter deals with Python. I must admit that, in my opinion, this chapter aims to cover too many subjects at once. It might prove to be difficult for the reader to absorbe all the information provided.But if the reader manages to keep up with everything, there are a lot of useful examples and all the main features of Python are discussed.In the fifth chapter, the user is guided through creating a game that is programmed in Python, and the author shows how to create a simple game controller, building it from scratch.After this, there’s a chapter that focuses on using Google Maps inside a Python program and teaches how to personalize a program adding buttons and other widgets to it.The last chapter focuses on how to play notes and songs using Sonic Pi. Readers will understand how to do it via simple commands, writing a program that acts as a complete composer.The entire book is full of really interesting examples, but I am under the impression that it shows the readers the pros and cons of different technologies without going deeper in any of them. A little more that 120 pages can’t be enough to discuss all the fascinating topics mentioned in the book.The book doesn’t seem to be suitable for kids, but it would be a good choice for parents who want to learn to program captivating games, maybe to share them with their children.In this way, it can be wonderful choice, but if you want to continue to program games, you are bound to need further reading, at least about Scratch and Python.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.