You are previewing Scratch Cookbook.
O'Reilly logo
Scratch Cookbook

Book Description

If want to get your programming know-how off the starting blocks in a fun, involving way, then this guide to Scratch is perfect. In no time you’ll be building your own interactive programs that include animations and sound.

  • Get started using Scratch, or take your programs to a new level using simple, easy-to-read recipes

  • Learn techniques for animating stories

  • Create fun and engaging games

  • In Detail

    Scratch 2.0 is an easy to use programming language that allows you to animate stories and create interactive games. Scratch also gives you the capability of using programming to calculate complicated calculations for you.

    Scratch Cookbook will lead you through easy-to-follow recipes that give you everything you need to become a more advanced programmer.

    Scratch Cookbook will take you through the essential features of Scratch. You’ll then work through simple recipes to gain an understanding of the more advanced features of Scratch.

    You will learn how to create animations using Scratch. Sensory board integration (getting input from the outside environment) will also be covered, along with using Scratch to solve complicated and tedious calculations for you. You’ll also learn how to work through the exciting process of project remixing where you build on the work of others.

    Scratch Cookbook will give you everything you need to get started with building your own programs in Scratch that involve sounds, animations, and user interaction.

    Table of Contents

    1. Scratch Cookbook
      1. Table of Contents
      2. Scratch Cookbook
      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. More information
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Getting Started with Scratch
        1. Introduction
        2. Starting up Scratch
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Deleting the default sprite
          1. Getting ready
          2. How to do it…
          3. There's more…
        4. Adding a custom sprite
          1. Getting ready
          2. How to do it…
        5. Adding a pre-made sprite
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        6. Changing the stage background
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        7. The Hello World project
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Adding some motion
            2. Special sprite settings
            3. Pointing towards the mouse
            4. Duplicating code
          5. See also
      9. 2. Storytelling
        1. Introduction
        2. Adding words to a sprite
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Adjusting the timing
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Sprites interacting with other sprites
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Basic broadcasting and receiving
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. The broadcast block
            2. The receive block
            3. More about the code
          4. There's more...
            1. Triggering an event with a click
            2. Changing the background
          5. See also
        6. Resetting parts of a program
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Other fun graphic effects
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Fisheye
            2. Whirl
            3. Pixelate
            4. Mosaic
            5. Brightness
            6. Ghost
          5. See also
      10. 3. Adding Animation
        1. Introduction
        2. Changing sprite costumes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
            1. Making it dance
            2. Checking the costume number
            3. Switching to a particular costume
          5. See also
        3. Switching backgrounds in a story
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Adding graphic effects to backgrounds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. A finished message
            2. Adding other effects
            3. Animating the button
          5. See also
        5. Keyboard input to a program
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Using better defined variables
          5. See also
        6. Getting the mouse position
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      11. 4. Basic Gaming
        1. Introduction
        2. Creating a moving object
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
            1. The simple way
        3. Adding another ball
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Object interaction with a background
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. User interaction with a game
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Using mouse control
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Keeping score
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Objects disappearing
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Building a maze
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        10. Using the timer
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      12. 5. Spicing up Games
        1. Introduction
        2. Tracking the best score or time
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
        3. Keeping a high score list
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        4. Adding more levels
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      13. 6. Bringing in Sound
        1. Introduction
        2. Playing sounds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Importing a new sound
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        4. Recording a sound
          1. Getting ready
          2. How to do it...
          3. See also
        5. Playing drums and notes
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        6. Adjusting volume
          1. Getting ready
          2. How to do it...
          3. See also
        7. Fading volume out
          1. Getting ready
          2. How to do it...
          3. See also
        8. Changing the tempo
          1. Getting ready
          2. How to do it...
        9. Interactive note playing
          1. Getting ready
          2. How to do it…
          3. How it works…
      14. 7. Integrating PicoBoards
        1. Introduction
        2. Setting up the sensor board
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Getting values from the sensor board
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Working with the slider
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
        5. Integrating the light sensor
          1. Getting ready
          2. How to do it...
          3. See also
        6. Integrating the sound sensor
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        7. Measuring resistance
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. The sensor board button
          1. Getting ready
          2. How to do it...
        9. Checking other connections
          1. Getting ready
          2. How to do it…
          3. There's more…
      15. 8. Programming to Calculate
        1. Introduction
        2. Generating Fibonacci numbers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Sieve of Eratosthenes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Creating a password generator
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Other Scratch calculations
          1. Getting ready
          2. How to do it…
      16. 9. Project Remixing
        1. Introduction
        2. Importing parts of other projects
          1. Getting ready
          2. How to do it...
        3. Drawing with the pen
          1. Getting ready
          2. How to do it...
          3. See also
        4. Remixing the pen project
          1. Getting ready
          2. How to do it...
      17. A. Collaboration
        1. Introduction
        2. The online Scratch community
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. See also
        3. Creating an account
          1. Getting ready
          2. How to do it...
          3. See also
        4. Sharing projects
          1. Getting ready
          2. How to do it...
          3. See also
        5. Sharing Scratch 1.4 projects
          1. Getting ready
          2. How to do it...
        6. Downloading projects
          1. Getting ready
          2. How to do it...
      18. Index