MIT SCRATCH COURSE

editing tips

Editing tips

It’s useful to learn how to copy and delete code blocks, and duplicate sprites.

Tip: You can use Ctrl-z (hold down the Ctrl key and tap ‘z’) to undo lots of actions in Scratch. If you accidentally delete a Sprite or other item, you can use Restore from the Edit menu to get it back.

You can delete code blocks you don’t need any more:

Deleting and restoring in Scratch

You can delete a block by right-clicking on it and selecting Delete Block from the menu.

A script of blocks with a pop up menu from the bottom block. The last option 'Delete Block' is highlighted.

To delete a group of blocks, left-click on the top block to be deleted and drag it to the Blocks menu. All blocks underneath it will be deleted too.

To restore blocks you have deleted in error, right-click and select Undo from the menu.

The Code area with right-click popup menu showing in an emtpy spot away from the code blocks. The top option 'Undo is highlighted.

An animated gif showing the user dragging the last 3 blocks in a script from the Code area to the Blocks menu. The blocks then disapear from the script. The user then right-clicks in an empty space in the Code area and selects the top option 'Undo' fromthe pop up menu. The blocks reappear.

You can also delete a sprite by clicking on the sprite’s Trash can in the Sprite pane.

A sprite icon in the Sprite list. It is highlighted in blue to show it has been selected and there is a trash can icon in the top right.

To restore a sprite, including all of its code blocks, go to the Edit menu and select Restore Sprite

The edit menu at the top of the Scratch editor with tp option 'Restore Sprite' highlighted.

An animated gif showing the user deleting a sprite from the Sprite list by clicking on the trash can icon. The user then goes to the top menu and selects 'Edit' then 'Restore Sprite' and the sprite returns along with the code blocks associated with the sprite at the time of deleting.

Duplicating or copying code can save you time when making a project.

Duplicate blocks

Duplicate blocks or sets of blocks to reuse in a sprite’s program:

  • Go to the Code tab.
  • Right-click (or on a tablet, tap and hold) on the first block that you want to copy. It will select all the blocks below it too.
  • Select Duplicate in the drop-down menu.
    Selecting 'Duplicate' in the menu.
  • Drag the duplicated code where you want it to go.
    Moving the duplicated code.
  • Delete any blocks that you do not need.

Duplicate a sprite

Right-click (or on a tablet, tap and hold) on your first sprite in the Sprite list below the Stage:

The Sprite list, with the first sprite highlighted and a pop-up menu showing the options 'duplicate', 'export', and 'delete'.

Select duplicate. This will create a copy of your first sprite, with the suffix “2”:

The Sprite list showing the first sprite and the duplicate sprite.

Rename your sprite:

The Sprite pane, with the 'Sprite' field highlighted.

Your sprite’s name will change in the Sprite list:

The Sprite list showing the duplicate sprite with a new name.

Your second sprite has exactly the same code as your first sprite. Do not run the program until you have started to change the second sprite’s code — you might not see the second sprite because it might be positioned underneath the first sprite.

Create a new sprite and copy over all or some of the first sprite’s code.

Copy a sprite’s code

In the bottom right-hand corner of the Sprite list, click on Choose a Sprite and select the sprite that you want to add.

Click on the first sprite and go to its Code tab. Drag the code that is in the first sprite’s Code area to the image of the second sprite in the Sprite list, then let go of the code to finish copying it to the second sprite. You may have one script that starts with a when green flag clicked block, as well as another script that starts with when this sprite clicked. Make sure that you copy all the code scripts that you have created.

Copying code to another sprite.

Your second sprite will now have exactly the same code as your first sprite. Do not run the program until you have started to change the second sprite’s code — you might not see the second sprite because it might be positioned underneath the first sprite.

If you want to copy costumes, sprites, sounds, and scripts between projects, drag them into the Backpack.

Using the Scratch Backpack

  • You can use your Scratch Backpack to store costumes, sprites, sounds, and scripts that you want to copy between projects.

  • You can only access your own Backpack, and you must be logged in to your Scratch account to use it.

  • To open your Backpack, click on the Backpack tab at the bottom of the screen.

Clicking on the Backpack tab just below the Code area opens the Backpack.

  • To add a sprite to your Backpack, drag the sprite from the Sprite list to the Backpack. This will store the full sprite in your Backpack, including all of its costumes, sounds, and scripts.

Dragging the Turtle 2 sprite from the Sprite list to the Backpack to add it.

  • To add a backdrop to your Backpack, select the Stage pane and click on the Backdrops tab, then choose the backdrop that you want and drag it to your Backpack.

Dragging an island backdrop from the Backdrops tab to the Backpack.

  • To use an item in your Backpack in another project, open the project and drag the item from the Backpack to the correct pane or tab.

Dragging the Turtle 2 sprite to the Sprite list, and the island backdrop to the Stage pane, in a new project.

  • To delete an item in your Backpack, find the item in the Backpack tab, then right-click (or on a tablet, tap and hold) on the item and select delete.

Right-clicking on the Turtle 2 sprite in the Backpack, then selecting 'delete' to delete it.

  • You can hide your Backpack when you are not using it. To do this, click on the Backpack tab at the bottom of the screen.

Clicking on the same Backpack tab used to open the Backpack, to hide the Backpack.

It’s always worth spending some time making sure you have followed best practices so your project is easy to understand.

Best practices for Scratch projects

  • Name all sprites, costumes, sounds, variables, and messages sensibly. It’s much easier to understand projects that use helpful names.
  • Fill in the Project Page with a good title, instructions, and notes so that users know how to use your project and where you got ideas from.
  • Add short comments that explain what your code is doing.
  • Make sure your scripts are tidy in the Code tab. You can right-click and choose Clean up Blocks or arrange the scripts in a way that makes sense to you. Try and put similar scripts together.