Time for action - roll call

Let's rename our sprites:

  1. Select Sprite1 from the sprites list.
  2. Look at the Sprite Info section in the middle third of the screen. Next to the rotation buttons, the text Sprite1 displays in an entry field.
    Time for action - roll call
  3. Delete the text Sprite1.
  4. Enter Happy Birthday.
  5. Rename the remaining sprites with a memorable name, such as First M, Second M, and O.
Time for action - roll call

Each sprite in the sprites list can now be identified by a unique name.

Choose appropriate names

To the computer, Sprite3 is just as good as First M, but humans benefit from associating sprites, costumes, backgrounds, lists, variables, and messages to descriptive names. In our example project, we spell Mom from individual sprites. How do we know if Sprite2 is the First M or the Last M? But if we rename Sprite2 to First M, we have no doubt.

In addition to providing context, names provide a way for us to easily identify our objects later. For example, if we broadcast one message as "message 1" and another as "message 2", we may not know which message does what when the time comes to make a sprite perform an action based on a message. If the message becomes "hi mom," then we know that the message signals the beginning of the mom animation.

Because meaningful names give us a context and understanding about the object, it helps us and other programmers understand our code later. Meanings may be fresh while we create our project, but what happens in two weeks or two months when we need to figure out what "message 1" controls?

As we create our projects, don't rely on Scratch's default naming. Change it as necessary.

Graphical transformations

We can change the appearance of a sprite very easily, as we have seen with the Happy Birthday card, and Scratch includes several special effects that we can apply directly to the sprite.

The effects in the following table can be found in the change color effect by 25 and set color effect to 0 blocks in the Looks palette:

Graphical transformationsHappy Birthday wishes project, creatingsprites name, selecting

Effect

What it does

color

Changes the color of the sprite.

fisheye

Distorts the sprite with a rounded edge as if you're looking at it through a glass or peep hole.

whirl

Twists the sprite around a center point and produces an effect similar to throwing a pebble in the water.

pixelate

Increases the size of the pixels in the image so that you can see them. Creates a blurry image.

mosaic

Splits the sprite into a pattern of smaller images of itself.

brightness

Increases the luminance of the sprite to make it appear brighter.

ghost

Makes the sprite transparent so that you can see other sprites and backgrounds through the sprite.

To apply more effect, increase the numeric value. You can also apply a negative-value to each effect.

Let's experiment with some graphic effects.

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

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