IAN LANG ELECTRONICS

So far in this course of articles we've been using the annoying cat that comes up as the default sprite in Scratch, and with the annoying cat comes an equally annoying default sound which is a meow.

 

Here's the project page:

 

Coding for Primary Schools

Back to Title

Adding Sound (Simple)

scratch.mit.edu/projects/48124838/

If you start this off then you'll see the cat walks as normal and if you left click on him with the mouse you'll hear him meow. If you don't hear him meow check the volume level of your speakers because I spent ten minutes swearing at it before I realised mine were on mute so don't make that mistake.

 

The reason he can do more than one thing at a time is because he has three event handlers like so:

catthreehandlers

Now, here's an interesting experiment. Press the space bar to make the cat walk. Press the F key. He'll meow, but stop walking. he won't start walking again until you let the space bar go and press it again. Make him walk and left-click on him with your mouse. Now he'll walk and meow.

 

Here''s where you find them:

 

sounds spriteclicked

So that should have been all fairly painless. Next comes something that'll cause a lot of headaches indeed because what we are going to do is to make two sprites work together and give the cat a 'shadow'. Did you think I'd let you get away with three easy lessons in a row?  BWUHAHAHA!

Next Lesson>