1 / 13

Scratch

Scratch. Responding to Input. Lesson Objectives. Look at what the term input means See how to control a sprite using keys See how to move a sprite in small steps Change sprites (or costumes). Movement costumes. Before we start coding we need our costumes!

ivi
Download Presentation

Scratch

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scratch Responding to Input

  2. Lesson Objectives Look at what the term input means See how to control a sprite using keys See how to move a sprite in small steps Change sprites (or costumes)

  3. Movement costumes Before we start coding we need our costumes! We need to create a sprite for each direction they will be facing. This can be done by rotating the sprite and tweaking.

  4. Importing costumes This can be done on the costumes tab. Simply click import and load up the 4 images

  5. Responding to key press Under control is the “when x key pressed” Anything connected to this will run when that key is pressed. You can choose the key by selecting from the drop down

  6. Sequence of events What are the sequence of events for going left? And no it is not just “go left”!

  7. Sequence of events Change costume to “left” Move 4 spaces. This will be the same for each key press You will also need to choose the right axis (x or y)

  8. Solution Notice that it is repeated for each key press Left and right use x Up and down use y

  9. Activity Create a new scratch file Create a sprite with 4 costumes (up, down, left and right) Import your spite and costumes Get your sprite to move!

  10. Finding a sound loop Do a search for “sound loops” to find a short bit of music to play. Flash kit is a great place to start

  11. Import sound You can import a WAV or MP3 file This is imported into a sprite the same way a costume is

  12. On click play some music! To play the sound we need the code on the right. Note that the colours represent the section each command came from. You could loop the sound if you wanted to!

  13. Activity 2 Add music when you click on your sprite

More Related