Build Your Own Clock

In this project, you will model a clock that displays the current time. Your code will make the second hand, minute hand and hour hand rotate properly and keep track of time.
Clock animation
  1. To build a clock, you will need to figure out how many degrees the second hand must turn every second. How should the minute hand rotate every minute? From one hour to the next, how many degrees must the hour hand rotate?
  2. Click here to load this file. Then save it to your Snap! account.
    This starter file gives you three sprites with costumes for the second, minute and hour hands. The red second hand also contains a sound file for “clock ticking”.
  3. You may find these blocks useful while writing the code for the second hand.
    go to front play sound (Tick)
    Time sensors in Sensing Menu will report the actual current time. For example when the current time is 10:45:20 these blocks will report:
    current (hour) reporting 10 current (minute) reporting 45 current (second) reporting 20
  4. Try, on your own, to write code for each sprite, telling it where to point at the current time. Look at these hints for Build Your Own Clock only if you are really stuck.
  1. On most clocks with hands, the hour hand moves continuously rather than jumping all at once at each new hour? For example, the hour hand points between 12 and 1 when the time is 12:26:36. If your hour hand jumps from hour to hour, adjust your code to implement this more realistic movement.
    Clock hands at 12:26:36
  2. Choose or draw costumes for the hands and clock to build a designer’s clock/watch in your own style. You can draw images, or find them on the web and use an image editing software such as Adobe Photoshop to edit and properly orient them. You will need to anchor the costumes properly by setting the rotation center at the appropriate point.
    Sprite rotation center assigned
  3. Create an alarm clock that takes some input from the user and beeps or rings when the time is up. To store the user input, you will need to learn how to make a variable using the Variables menu.
    Make variable alarm Hour
  4. Build a “Grandfather Clock” with a swinging pendulum in its mechanism. Or a “Cuckoo Clock” that has an animated bird that shows up at regular intervals.