0%

Book Description

Leverage the power of programming to use the Raspberry Pi to create awesome games

In Detail

The Raspberry Pi is a single-board mini computer designed to get more people (particularly children) interested in computer programming. It aims to make programming tools and educational programs as accessible as possible, making it very easy to get started with.

This book will guide you through six fun projects that show how programming can be used to be creative. Each project has clear step-by-step instructions and explanations helping children grasp the concepts easily.

You will start by setting up the Raspberry Pi and get to grips with the Scratch programming language to create simple animations. Gain and put to use your understanding of Python to write simple yet useful programs. Create and play a physical game by connecting it to the Raspberry Pi en route to become aware of a number of other possible uses for a very similar circuit/program. Finally, with an understanding of Sonic Pi, you will create your own music.

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

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. 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.

Table of Contents

  1. Raspberry Pi Projects for Kids Second Edition
    1. Table of Contents
    2. Raspberry Pi Projects for Kids Second Edition
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Getting Started with Raspberry Pi
      1. Materials needed
        1. Power supply
        2. Storage
        3. Input
        4. Video
        5. Network
      2. Preparing the SD card
      3. Starting up the Raspberry Pi
      4. Using your Raspberry Pi
        1. The command line
        2. Updating and installing new software
        3. Other uses of the Raspberry Pi
        4. Troubleshooting common issues
      5. Summary
    9. 2. Animating with Scratch
      1. Scratch
        1. Hello world!
        2. Code tour
        3. Some more interesting movements
        4. Setting the scene
        5. Another way to animate
      2. Interactive animation
        1. Variables
        2. Movement
        3. Keeping count
        4. If-then-else
      3. Summary
    10. 3. Making Your Own Angry Birds Game
      1. Creating a character
      2. Creating a level
      3. Moving the character
        1. Initialization
        2. Moving the character with the keyboard
        3. Launching the character!
        4. Flight
      4. Adding physics
        1. Gravity
        2. Bouncing
      5. Ending the game
      6. Scoring
      7. Extensions
      8. Summary
    11. 4. Creating Random Insults
      1. Python
        1. Python programming
      2. The program we're going to use to generate phrases
        1. Lists
        2. Adding randomness
        3. Creating phrases
      3. Making mischief
        1. Dictionaries
        2. Loops
        3. Conditionals
        4. Functions
      4. Complete code listing
      5. Summary
    12. 5. Testing Your Speed
      1. Materials needed to make your own controller
      2. Creating the game controller
        1. The controller base
        2. Adding buttons
        3. Connecting to the Raspberry Pi
      3. Coding the game
        1. Random behavior
        2. Using the controller
        3. Adding a time limit
        4. Bringing it all together
      4. Complete code listing
      5. The keyboard version
      6. What's next?
      7. Summary
    13. 6. Making an Interactive Map of your City
      1. Hello world!
        1. Tkinter
        2. Writing the program
      2. Getting a map
        1. No Internet? No problem!
        2. Google Maps
        3. Generating the address
        4. Downloading an image
        5. Using an image
      3. Adding markers
        1. Detecting mouse clicks
        2. Reacting to mouse clicks
      4. Adding labels
        1. Basic labels
        2. Pop-up windows
      5. Code listing
      6. Extensions
        1. Layout
        2. Additional widgets
          1. Checkbutton
          2. Frame and LabelFrame
          3. Listbox
          4. Menu
          5. Menubutton
          6. Message
          7. OptionMenu
          8. Radiobutton
          9. Scale
          10. Spinbox
      7. Summary
    14. 7. Building Beats with Sonic Pi
      1. Sonic Pi
      2. Getting started with Sonic Pi
      3. Creating a tune
      4. New sounds
      5. A real tune
        1. Adding rhythm
        2. Bass line
        3. More fun
      6. Code listing
      7. Summary
    15. Index
3.21.104.183