Friday, February 12, 2016

Valentine's Day Greeting Card - programmed with Scratch

With Valentine's Day coming up, this week I decided to do a fun little Scratch project with my child's class - make animated Valentine's Day greeting cards. The lesson plan is meant to introduce the kids to the following concepts:
  1. create animation effects by changing the size of a sprite
  2. make clones/ copies of a sprite
  3. position a sprite at a random location 
  4. provide background music for the animation
I made this sample skeletal program to use as a starting point.

There are 4 sprites in my sample program - Heart Face, Greeting, Balloon, and Heart.









The Heart Face has the animation effect of getting larger and then smaller, multiple times. This is achieved by changing the size of the sprite multiple times via the "change size by __" instruction, in a repeat loop.

I also added some background music to the Heart Face sprite. This piece of code for the music can however be added to any of the sprites to create the same effect, as it is set off with the green flag click. You could also add extra sound effects by recording the voice of the kids shouting out "Happy Valentine's Day", and adding it to the Heart Face sprite's code using the "play sound __" instruction.

The Ballon sprite and the Heart Sprite have almost identical code:
Both create multiple clones of themselves in a repeat loop. Each clone appears in a random location. The complete range of X and Y positions are covered here, by using the maximum values of XY coordinates seen on the Scratch screen.

The simplest code is for the Greeting - just position it at a suitable XY position and set it to a fixed size. You could also add more instructions to make it change color or so.

The class came up with a whole variety of animated greeting cards. While some kids preferred to make cards similar to the sample, there was a lot of out of the box thinking too :) as in this project that my child came up with.

Happy Valentine's Day! Enjoy the weekend!

No comments:

Post a Comment