Watch Out when Removing Sounds and Sprites

Unlike many programming languages, Scratch is extremely forgiving when it comes to what in many programming languages would be considered a major error. For example, let’s say you created a script that played an audio file named meow, as demonstrated below, and you later decided to remove the audio file from your application but forgot to remove the sound block in the script. It would certainly be logical to expect that when you ran your application, an error would occur. But this will not be the case.

Rather than preventing application execution and highlighting the error, Scratch overlooks the problem and runs your application anyway. When it comes time to play the missing audio file, scratch just ignores the problem. This behavior can be a double-edged sword, because on the one hand your application still runs. However, unless you carefully test the execution of your application after deleting the sound file, you may not discover the error, and the overall quality of your application will suffer.

Scratch is just as forgiving when it comes to the management of sprite costumes. Suppose, for example, that you added a costume named bat1-a to a sprite and then used the following script to switch its costume:

If sometime down the road you decided to modify your application by removing the costume from the sprite, Scratch would not flag the oversight as an error and would instead allow your application to run, ignoring the costume switch error when it came across it. Again, this type of behavior is a double-edged sword and can only be overcome by careful modification and retesting of your Scratch applications any time you decide to change or remove a sound, costume, or background.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.2.184