PDF download Download Article PDF download Download Article

Scratch is a popular visual programming language developed by MIT Media Lab as a children's educational tool. It is available online, with desktop versions available for Mac OS, Windows, Chrome OS, and Android. This wikiHow teaches you the basics of how to make a game

Part 1
Part 1 of 4:

Downloading Scratch

PDF download Download Article
  1. Navigate to the Scratch Download page in a web browser. This is the web page where you can download the desktop version of Scratch.
  2. It's below the option to download Scratch from your system's digital store.
    • Alternatively, you can click Create at the top of the web page to start creating immediately online inside your web browser.
    Advertisement
  3. The Scratch install file is "Scratch Desktop Setup 3.9.0.exe" for Windows, and "Scratch 3.6.0.dmg" for Mac. Once the install file is finished downloading, double-click the install file to begin the install process. You can find downloaded files in your Downloads folder or in your web browser.
  4. Use the following steps to install Scratch:
    • Windows
      • Select "Only for Me" or "Anyone who uses this computer".
      • Click Install
      • Click Yes to allow the Scratch installer to make changes to your system.
      • Click Finish .
    • Mac:
      • Scratch the Scratch app icon to the Applications folder.
  5. Advertisement
Part 2
Part 2 of 4:

Adding Graphics

PDF download Download Article
  1. It has a yellow icon with an S on it. Click the icon in the Start menu on Windows. You can find it in the Applications folder on Mac.
    • The first time you open Scratch, it asks if you want to send data to the Scratch team to help improve Scratch. You can click No thanks or Yes, I'd like to help improve Scratch . If you select Yes, usage data will be sent to the Scratch team. The Scratch team does not collect personal information.
  2. To add a background in Scratch, click the icon that resembles a photograph in the lower-right corner. Then select an image to use as a background. You can use the tabs at the top to browse backgrounds by category or use the search bar in the upper-left corner to search for background by name.
    • To upload your own background, hover the mouse cursor over the icon that resembles a photograph and click the icon that resembles a trey with an arrow pointing up. Click an image you want to use as a background and click Open .
    • To draw your own background, hover the mouse cursor over the icon that resembles a photograph and click the icon that resembles a paintbrush. Use the paint tools to paint your own background.
  3. Sprites are image objects that are part of the game scene. They can be the player character, enemies or obstacles, non-player characters, power-ups and consumables, or animated background objects. To add a sprite, click the icon that resembles a cat in the lower-right corner. Then click a sprite you want to add to your scene.
    • Like backgrounds, you can upload and paint your own sprites to your scene. To do so, hover the mouse cursor over the icon that resembles a cat and click the icon that resembles a trey with an arrow pointing up to upload your own sprite. Click the icon that resembles a paintbrush to paint your own sprites.
    • If you need to delete a sprite, click the sprite in the list below the Preview window in the upper-right corner and press the Delete key.
  4. The preview window is in the upper-right corner. Click and drag the sprite to where you want it to be at the start of the game.
  5. Advertisement


Part 3
Part 3 of 4:

Adding Controls and Motion to a Sprite

PDF download Download Article
  1. Click the sprite icon below the preview window in the upper-right corner to select a sprite.
  2. It's the first tab in the upper-left corner below the Scratch logo.
  3. In Scratch, the coding is done using blocks. All the blocks are listed in the panel to the left under the blocks tab. The blocks are color-coded by type. Event blocks are color-coded yellow. Click the yellow dot to the left to jump to event blocks. Then drag an event block into the code area to the right of the list of blocks. An event block can be something like "When this sprite is clicked", "When [key] is pressed" or "When [green flag icon] is click".
    • The game sequence starts when you click the green flag icon above the preview window. Use the block that says "When [green flag icon] is clicked" to create an action that starts as soon as the game starts. It's at the top of the Events blocks. It has an icon with a green flag in it.
  4. The motion blocks are color-coded in blue, and the Look blocks are color-coded in purple. Find a block for what you want to have happen. Drag it into the code area and attach it below the event block in the code area. Notice how the blocks have a notch above and below them. Insert the notch for the action block into the event block.
    • If the block has an arrow pointing down (⏷), click the arrow to display a drop-down menu. Select an option (such as keyboard key) from the drop-down menu.
    • If a block has a white bubble with text in it, you can change the text inside the bubble.
  5. It takes a bit of experimentation to figure out how to get the blocks to do what you want. Try attaching different blocks and see what happens. The following are a couple of example blocks you can try.
    • Example blocks 1: Select "When this sprite is clicked" as an Event block. Then attach the block that says "say [hello!] for [2] seconds" from the Looks blocks.
    • Example blocks 2: To make a sprite move left and right when you press the left and right arrow keys, add event block that says "When [right arrow ⏷] is pressed". You'll need to select the right arrow key from the drop-down menu in the block. Then attach a block that says "point in direction [90]" from the motion blocks. Then attach another motion block that says "move [10] steps". Then drag another event tag into the code area that says "When [left arrow ⏷] is pressed" attach a motion block that says "point in direction [-90]", and attach another motion block that says "move [10] steps".
  6. Advertisement
Part 4
Part 4 of 4:

Adding Variables and Collision Detection

PDF download Download Article
  1. It's the orange dot in the panel to the left. This displays the Variable blocks. Variables are what is used to make things like the score, lives, health meter, etc.
  2. It's above the list of variable blocks. This opens a window you can use to make your own variables.
  3. You can name it something like "Score," "Lives," "Coins," or whatever you want to change when your sprites collide.
  4. It's in the Events blocks. It's the block with a green flag in the text.
  5. It's in the variable blocks. Use the drop-down menu in the block to select the variable you created.
  6. For example, if you want to create a score, you would set it to "0" at the beginning of the game. For lives, enter the number of lives you want your character to have at the start of the game.
  7. It's in the "Control" section. This block has a notch in the middle to add blocks in the middle of it.
  8. The "If/Then" block also has a notch in the middle. In addition, it has a hexagon key after "If".
  9. The "Touching" block is at the top of the Sensing blocks. Drag it into the hexagon key in the "If/Then" block.
  10. Use the drop-down menu in the block to select another sprite. For example, it can be an enemy sprite, a power-up, or a simple item that changes your score.
  11. If you want to create a complex death sequence, that may take some experimentation with the motion controls to get it exactly right. To change the variable, attach the variable that says "change [variable] by [blank] to the "If/Then" block. Use the drop-down menu in the "change variable" block to select the variable you want to change. Enter the amount you want it to change by in the white bubble. For example, enter "1" in the white bubble to increase your score by 1 point. If you want to take away a life, enter "-1" in the white bubble.
  12. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I make an online multiplayer game for an unlimited number of people (so that each person has a sprite)?
    Gerassimos Moutafis
    Community Answer
    If you want to make an online multiplayer game, you need to create cloud variables on Scratch version 2.
  • Question
    Is it possible to convert Scratch code to a programming language like Java or Python?
    A8b5
    Community Answer
    Yes, but it requires some other basic knowledge of those programming languages. For example, using WoofJS, you can convert scratch to Javascript.
  • Question
    Can we add our own blocks?
    Heihei
    Community Answer
    Yes, there is a thing called "My blocks," which lets you define what it does.
See more answers
Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!

      About This Article

      Article Summary X

      1. Open Scratch.
      2. Click the icon that resembles a photograph in the lower-right corner to add a background.
      3. Click the icon that resembles a cat to add a sprite to your game.
      4. Click the Code tab.
      5. Click a sprite you want to control and drag an Event block into the code area.
      6. Attach Motion, Look or Control blocks below the event block.
      7. Use variables to create a score, lives, and other HUD items. 8. Use the "Set Variable" block to set the starting points of the variables at the beginning of the game.
      9. Use the "If/Then" block to add events that happen when sprites touch. 10. Add a "Touching" block in the Hexagon key of the "If/Then" block and select a variable that can collide.
      11. Use the "Change Variables" block to change your variables when sprites touch.

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 36,426 times.

      Is this article up to date?

      Advertisement