Scratch 3.0 – Writing a Script
- Categories Uncategorized
Here we are going to cover how to write a Script in scratch. You can watch our video on Scratch 3.0 – Writing a Script – click here.
Q. What are different types of command? Explain use of them.
Ans. Different types of command
- The top most is the Motion block which has commands to moves sprites, changes angles and changes X and Y values.
- Looks commands which help you to controls the visuals of the sprite, change the background,
- Sound which helps you to add sound effects.
- events, which has event handlers placed on the top of each group of blocks.
- the control commands which have conditional if-else statement, “forever”, “repeat”, and “stop”, etc.
- Then there are the Sensing commands. Which help you to interact with other sprites or surroundings.
- Operators block are used to script math equations and string handling.
- Variables are used to hold values and strings. There are eight Stack blocks, four Reporter blocks and one Boolean block in this category.
- you can add even more commands by using add extensions. You can see more commands for Music, Pen, Video and if you select any of them they get added to your pallet.
Q. What are the different types of blocks in scratch? And explain.
Ans. Different types of blocks: Blocks also have different shapes. Based upon shape there are Hat type, Stack type, Reporter or Cap blocks
- Hat type blocks have rounded top like a hat. These are placed on top of the scripts and typically associated with some event which starts our script. They are found in the Events or Control Category.
- Then there are Stack type blocks which has dents or bumps to form stack of blocks.
- Then there are reporter blocks which holds values and fits inside other blocks. They can have numeric or Boolean values which help in taking some decision by the main block, like which key is pressed or touching mouse pointer etc.
- Last is the cap block, these come always last in the script and are used to stop one or all scripts.
Q. Name the tab and category of blocks that should be selected to do the following:
1 . Ask the user’s name
2 . Add a variable to store points of the game
Ans.
1 . Code tab/sensing category of blocks
2 . Code tab/ data category of block
Q. Name the tab and category of blocks that should be selected to do the following:
1 . to move the sprite
2 . show some text on stage
Ans.
1 . Code tab/Motion blocks
2 . Code tab/Looks blocks
Q. Name the tab and category of blocks that should be selected to do the following:
1 . change the costume of the sprite
2 . play drum beats
Ans.
1 . Code tab/Looks blocks
2 . Code tab/Sound blocks
Q. Name the tab and category of blocks that should be selected to do the following:
1 . draw circle on stage
2 . play music instruments
Ans.
1 . Code tab/Pen blocks
2 . Code tab/Sound blocks
Q. Name the tab and category of blocks that should be selected to do the following:
1 . show game score
2 . change the backdrop
Ans.
1 . Code tab/Variable blocks
2 . Code tab/Look blocks
Q. Name the tab and category of blocks that should be selected to do the following:
1 . Change background when space bar is press
2 . Sprite need to repeat same thing
Ans.
1 . Code tab/Event blocks
2 . Code tab/Control blocks