In this blog, we will hoist the Indian Flag with National Anthem by writing the code in the scratch editor. This Project is made and written by Ansh Agarwal of Grade IV From The Kalyani School, Pune.
So first, to see the preview of the animation below click on the flag icon and read the complete blog to make your own animation.
We will make this project by dividing the task into the two-part:
First we will decorate the stage with the sprite and with the background and then we will write the code to make the animation 🙂.
Stage Decoration: For the stage decoration first, we will decorate the stage with the sprite and then we will add a backdrop OR background.
First, you need to make a flag for that click on the Sprite button and go to the draw button.
Now make a flag with curves and put 5 costumes to make it look that it is swinging and add a brown stick as well.
Then make one more Sprite by adding the given objects like squares, circles, rectangles to make the person and paint it with colors whatever you want
Now put 5 costumes so that it looks like the person is moving the hand to salute.
And now we will add a backdrop or the Background
For this from the internet, find the image of the Indian flag and snip it and save it in the Document file.
To put the background, go to the Background option and then click on the Upload button.
When you see your document screen, click on the image which is saved and the background will be made.
Coding: We will write the code to make the animation
For the coding of the swinging flag, first, drag the ‘when flag clicked’ block from the events section.
Then from the control section, drag the block ‘wait 1 second’ and then change it to ‘wait 2 seconds.
Go in the sound section, click on the sound+ option, and then click on the record option.
From the internet, select the audio of the National Anthem, and click on the red button and immediately start the audio in full volume. After it is recorded, rename the voice as ‘National Anthem’.
Now click on the code option, go to the sound button, drag the first block, and put it after the ‘wait 2 seconds’ block.
Go to the Looks button, drag the ‘switch costume to’ whatever you renamed the flag sprite, and put it inside the forever block.
Go in the control button, drag the ‘wait 1-second’ block and change it to 0.5 seconds and put it below the ‘switch costume to’ block
And repeat the step five times and change the costumes every time to a new ‘switch costume to’ block.
For animating the man that you made, go to the events button, and drag the ‘when flag clicked’ block and go to the Looks button and drag the ‘switch costume to’ whatever you renamed the man sprite and put it below the ‘when flag clicked’ block.
Go to the control button, drag the ‘wait 1 second’ block and change it to 0.5 seconds and put it below the ‘switch costume to’ block.
Repeat the STEP 10 for 5 times and change the costume every time to a new ‘switch costume to’ block
Your coding is completed. Just click on the Green flag to start the animation project.
For more you can refer to the below 👇 link for more help or to remix my project, Thanks.
And if you're remixing my project, don't forget to add your project link in the below comment.
Still if you're facing any problem during making the project then you can ask your questions in the comment Box.
Made and Written By:
Ansh Agarwal ,
The Kalyani School, Pune.