Happy holidays! Tis’ the season to be merry and bright and also the perfect weather for a cup of hot chocolate.

Who doesn’t love all of the twinkling lights and decorations this time of year and, of course, the presents under the tree (especially the surprises!). 

📌 [Download] Printable Scratch Coding Tutorials Get 2 printable Scratch tutorials, Rocket Landing and Flying Space Cat, to code your own games step by step. Download Now

It’s been a little harder to shop for gifts this year, but that gives us the chance to get creative. If you want to learn how to code, there happens to be plenty you can gift without leaving the house. For you, we’ve created a codable Scratch gift that you can personalize and share with someone you care about. 

Code your own Holiday Advent Calendar in Scratch and slowly reveal gifts, goodies, or games to your family and friends.

Our advent calendar counts down until Christmas, but you can make yours for any holiday or special event. It’s a fun way to keep in touch and give a gift that comes from the heart.

Put on your matching pajamas, and let’s get coding!

See Complete Holiday Advent Calendar

Complete scratch holiday calendar

What you need:

  1. Scratch accountCreate a free Scratch account 
  2. Starter template: Use this Scratch starter template as the basis of your project. View starter template

No coding experience necessary for this tutorial. Beginner-friendly for ages 8 and up. Give it a try!

Step 1: Remix the starter project

We’ve set up the base files for you. Instead of creating a new project, start by remixing a project.

Step 1 scratch holiday calendar

Hint: You can personalize your calendar with your own background and sprite images.

Step 2: Add a gift for December 15

Our advent calendar starts on December 15. Let’s first add code to the date that tells our gift sprite what gift to open.

Step 2 scratch holiday calendar

Hint: Instead of a card, you could show an image, animations, or even start a game when you click on the date.

Step 3: Show the December 15 gift on click

When we click our calendar date, we want to reveal the gift. You’ll see some code added to the gift that hides it when we start our game. Let’s show the gift when we click. 

Step 3 scratch holiday calendar

Step 4: Hide the gift after you view it

The gift shows now! To close it, click on the sprite. The gift covers the whole page so anywhere you click will hide the gift.

Step 4 scratch holiday calendar

Hint: You could also show the gift for a specific amount of time by using the wait block. 

Step 5: Add logic to lock the future gifts 

Currently, we are revealing the gift when we click our calendar. Let’s add an if-else statement to help our code decide if it’s time to reveal the gift yet. If it is too early, we’ll show a message instead of our gift. 

Step 5 scratch holiday calendar

Reveal the gift only if the current date is after the reveal date:

Step 5 b scratch holiday calendar

Hint: For each calendar date sprite, you would change the value in the > block.

Step 6: Show an error when you try to open future gifts

Step 6 scratch holiday calendar