Basic Scratch Coding/Hello World
Hello World is a way of getting used to many programming languages, such as Python and HTML. In Scratch, however, this is conveyed by the use of sprites (characters), which can be programmed to say and think certain things. In this subpage, we will use this technique in Scratch, with the use of “say blocks”, which are used to make a character say something (in this case Hello World) in a speech bubble.
Starting Up Scratch
editTo start up scratch, first open your offline editor or the online editor at https://scratch.mit.edu, and press the “Create” tab on the top of the website, which will automatically create a fresh, new project for you to work on. If you are using the offline editor, open up your app, which will create a project for you straight away. This might take longer on some systems, though.
Setting Up Your Sprites
editFor this project, you will only need the basic Scratch cat, which will be there whenever you start up a new project on Scratch. Alternatively, you may also pick a sprite, which can be found by hovering over to the button which has a cat and a plus symbol as a symbol, and then pressing any of the options shown above, depending on what you want to do.
There are four options when it comes to adding sprites into Scratch:
- Surprise – a random sprite which the algorithm chooses from all sprites from its library
- Choose a Sprite – an option which allows you to choose a sprite (character) from Scratch’s library
- Paint – an option which allows you to create a sprite using the in-built editor of Scratch, with either the vector or the bitmap editor
- Upload a Sprite – an option which allows you to upload your own sprites from your computer using an image
You can use any of these options for your sprite, or stick to the basic Scratch cat.
Creating the Project
editYou will only require 2 blocks for this simple project, which are the “When green flag clicked” and the “say (text)” blocks, which are in the “Looks” and “Events” tabs respectively. (If you are on Scratch 1.4, the green flag block will be in the “Control” tab.). You only need to combine these two blocks to create this simple program. To do this, click on your current sprite and put the say block underneath it. Next, change the text from “Hello!” to “Hello World!” which will change the text. What does this show? I
Troubleshooting
editCompare your project to the one seen in the image. Are there any problems? Try and troubleshoot them and see where you went wrong. (If you are using the "think blocks", this will not apply.)
Conclusion
editWhat have you learned from here? Can you apply this project in other programming languages? How would you refine it so you can make it more original? Will you add any more actions? Take some time to think about these questions slowly. Also, take some time to experiment with the code and make it however you want.