Filters

Other

D

Your name is required for this document. It is only stored on this local computer and no where else. Please enter your name below:

Lesson 3Dancing Sprites

Knox badge
Lesson 3Dancing Sprites
  • How to animate a sprite
  • How to add to add sounds to Scratch
  • I will be able to make a sprite move
  • I will be able to make a sprite rotate
  • I will be able to play a sound in Scratch

In this lesson we are going to make our sprite dance. To get them to dance, we must animate them.

In computer science, animation means making a sprite move.

Finished product

You can see a preview of the finished drawing below:

Getting started

Select Choose a Sprite at the bottom.

At the top search for "dance" to find all sprites who have dance moves. Find "Anina Dance".

Playing sound

Now we are going to add some music in the background.

First, we need to find Sound on the left side.

Now find the play sound dance magic until done block and drag it into your code.

We need to attach this block to an event block. In this case, we're going to use the when clicked block.

When we have this, attach play sound dance magic until done block to the when clicked block.

Try out what you have just created.

Getting our character to dance

First drag another when clicked block into your sprite and underneath it add the next costume block underneath it.

Your code should look something like:

You should see the sprite change and the music playing in the background. Each time you click the green flag you will notice that the character changes to another pose and starts dancing. Let's make her keep on dancing.

We need to add a few more next costume blocks to our character. Let’s add three so that it looks like the following.

Try out what you have just created.

What happened? The character only changed once. Actually, the character changes three times very quickly – too quick for us to see. We need to add in a small time delay.

Find the wait 1 seconds block within Control tab on the left side.

Now drag one in between each of the next costumes so it looks like:

Computer programs

A computer program runs in sequence. This means in Scratch that the computer will run through each block one after the other, so the order is so important.

In order to make the character dance in the right way, the order is very important.

Repeating something

Computer are designed to repeat something over and over again to save time in building programs. Computers use something called a loop to repeat something over and over again. In Scratch we can save ourselves putting in hundreds of blocks by telling the computer to repeat this over and over again.

Find the Control tab on the left side and look for the repeat 10 times block.

Now place your block under a new when clicked block and then drag our blocks into it so that everything we have just created is inside that block and your blocks look like this:

Making the characters stop when the music stops

Did you notice that your character continues to dance when the music stops?

To fix this, change your blocks so that they look like the example shown on the right-hand side (note you will need to remove one of the next costume blocks too).

When you have done this, you should notice that your character stops dancing when the music stops. Can you think why?

Try out what you have just created.

Making the background change colour

We can also make the background look a bit more like a rave or disco by adding in a colour effect. First click on the backdrop on the right-hand side and then add the following blocks to the backdrop.

Try out what you have just created.

Stopping the animation

One block we have not come across yet is the stop all block.

To stop our animation running and to stop the background changing once the music has stopped, we need to use this block. In your Anina Dance sprite, we need to add the stop all block after the music stops so that it looks like:

  • 1

    Upload your screenshot below:

  • 2

    What word best describes the difference between a game and an animation?

  • 3

    The following code is added to a program. How many times will the sprite change costume?

    Loops
  • 4

    The following blocks are used in a Scratch program.

    Loops

    Notice that the next costume block is used three times. How could this be made more efficiently using loops?

  • 5

    What would happen if the wait blocks were removed from the program?

  • 6

    How well do think you completed this task?

  • 7

    What parts of this task, if any, did you struggle with?

  • Try adding another character, such as "Jouvi Dance", and make them dance too.
  • Try adding in another backdrop into your animation and see if you can work out how to change to that based on what you have learned so far.
S1 Scratch Lessons
S1 Scratch Extension Tasks
S1 Scratch Assessment
Assessment
Provide Feedback

What did you think of this lesson?

!
-- DragonDocs version 0.9 --

20.08.2017

Started on DragonDocs
Created a YASS/PHP and HTML-based system for saving and retrieving data

21.08.2017
Added CSS styles to page
Added JavaScript code to the page

02.02.2018
Added the multipage option (used in my dissertation)
Added the XMLHttpRequest-based multipage requests

08.02.2018
Added the Accessibility features
Filters added

10.02.2018
Purple filter added

17.03.2018
Added the Note class
Added the Did You Know class

-- DragonDocs version 1.0 (Yosemite) --

02.10.2019
First trial of DragonDocs in teaching

04.10.2019
Added the Task, Starter, Review your learning sections

07.10.2019
Added the feedback feature
Added the Dark Mode toggle

19.09.2020
Performance gains through the removal of unnecessary code
Added the Learning Intentions and Success Criteria features
Added the school badge

31.09.2021
Changed the headings (h2) to be more consistent with my website
Added sections to the pages - sections must be preceded by a h2
Added the "I have read this section" buttons
Changed the main heading zone to gradient text like my website
Added the table of contents feature

02.02.2022
Added the Print feature
Updated the footer to feature a new gradient
Added the Test It! class
Added the green flag
Automated the table of contents using JavaScript

06.02.2022
Added the 'includes' feature to the document, allowing inclusion of other files easily
Removed the requirement that the IP address must be one of the schools I have taught at, opening these documents to the public

02.03.2022
Once a section has been read or completed, the user can now hide that section

10.10.2022
Added the Extension task class
Changed the scrollbar on Windows to match that of macOS

-- DragonDocs version 2.0 (Kilimanjaro) --

07.08.2023
Added the Save button and the ability to save 'results' or answers to a Word document

12.01.2024
Added the large numbers class
Removed the background of the page navigation

-- DragonDocs version 2.1 (Aurora) --

08.02.2024
Added the active class to active links in the bottom section

09.02.2024
Added the image upload feature

10.02.2024
Added a fix that prevents the upload of non-image files into an image upload
Added pasting images to the upload feature

11.02.2024
Added the ability to view the changelog from a document
Improved the feedback system by recording the DragonDocs User ID and the Document ID data
The feedback from DragonDocs can be accessed much easier

12.02.2024
Added the new step_by_step_mode feature, allowing sections to be viewed individually
Added the ability to lock and unlock DragonDocs

22.02.2024
Added new checkboxes to each list item in a .task or .step
Added functionality to said checkboxes to add a strikeout to steps completed

23.02.2024
Added the new 'step' class
Steps are now auto incremented in CSS so the name displays the step number
Activities are now also auto incremented to display the activity number

25.02.2024
Added the 'matcher' feature to DragonDocs
Fixed an issue in which a closed section would retain it's original height within the document navigation
Added starters and the lesson review to the navigation on the side
The learning intentions and success criteria in teaching documents have now been redesigned to match my slides design

26.02.2024
All buttons are now on the right hand side
The accessibility button now has WAI under it

-- DragonDocs version 2.2 (Serengeti) --

26.02.2024
Code has been rewritten from the ground up to be object-oriented, making additional features easier to add

28.08.2024
Changed the look of grouped multiple choice buttons

06.03.2024
Added the new dragondocs_name feature and the requires_name property which allows names to be prepended to saved documents

09.03.2024
Added code so when the user types in their name and hits the enter key it will save that data and close the modal window
Added the new DragonShow and DragonDocs Link - a connection between both services that allows the presenter to communicate with users of DragonDocs from a DragonShow
Added the new timer option which is sent from DragonShows

04.04.2024
The matcher feature is no longer embed from jamiebalfour.scot but actually a feature of DragonDocs
Made DragonDocs 100% object-oriented, meaning much better management and better performance

05.04.2024
Made subtle changes to the interface to tidy it up a bit

06.04.2024
The multiple choice questions are now also part of the object oriented interface

09.04.2024
As requested, h3 elements are now included in the 'floating navigation'
The active navigation element now becomes bold and the left border has been retired

Time left

: