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.
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.
You can also delete a sprite by clicking on the sprite’s Trash can in the Sprite pane.
To restore a sprite, including all of its code blocks, go to the Edit menu and select Restore Sprite
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.
- Drag the duplicated code where you want it to go.
- 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:
Select duplicate. This will create a copy of your first sprite, with the suffix “2”:
Rename your sprite:
Your sprite’s name will change in the Sprite list:
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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.