How to Make Day & Night Animation in Scratch (Step-By-Step Full Tutorial)

Published By Kodex Academy — Learn. Build. Innovate.
How to Make Day & Night Animation in Scratch step by step full tutorial by Kodex Academy

Introduction – Day & Night Animation in Scratch

If you’ve ever wondered how to make day and night animation in Scratch or wanted to bring your stories and games to life with realistic sky transitions, this tutorial is perfect for you! Scratch is widely known for its beginner-friendly block-based programming, but with just a few smart techniques, you can create impressive visual effects like sunrise, sunset, and moonlit night scenes—all without writing traditional code.

In this step-by-step guide, inspired by the Kodex Academy YouTube tutorial, you’ll learn how to build a dynamic day-night cycle animation in Scratch. We will create an engaging Day-Night animation effect featuring:

  • Sunrise + Sunset
  • Sun & Moon Gliding Motion
  • Walking Character (Snowman)
  • Background transitions
  • Brightness change
  • Stars Twinkling
  • Background music

🎥 Watch the full tutorial on YouTube → How to Make Day & Night Animation in Scratch | step by step full tutorial by Kodex Academy

By the end of this blog, you’ll be able to:

  • ✅ Design custom backdrops
  • ✅ Animate characters and objects
  • ✅ Create smooth day-to-night transitions
  • ✅ Add glowing stars and visual effects
  • ✅ Enhance your project with sound and extra animation features

So grab your creativity and let’s dive into this fun Scratch programming animation tutorial to make your very own sunrise-to-sunset day and night cycle!

What You Will Learn

  • Import / Prepare Backdrops
  • Creating costumes for walking animation
  • Coding sprite movement
  • Creating sun & moon glide animation
  • Switching backdrops
  • Brightness effects
  • Adding stars with twinkle effect
  • Adding background sound
  • Extra enhancements & improvements

Coding – Day & Night Animation in Scratch

1. Setting Up Backdrops – Day & Night

  1. Go to Stage → Backdrops
  2. Upload:
    • Day Background
    • Night Background
  3. Convert them to Vector
  4. Center them

If you need free sky backgrounds, you can explore: https://www.pixabay.com or https://www.pexels.com

2. Adding Character & Creating Walking Animation (Sprite Costumes)

  1. Delete default cat
  2. Choose new sprite → Snowman
  3. Duplicate its costume 4–5 times
  4. Edit each duplicate → Move:
    ✅ Legs forward/back
    ✅ Hands forward/back

Now your snowman looks like it’s walking when costumes loop.

Snowman Code (Walking + Screen Reset + Day → Night Switch)

when green flag clicked
go to front layer
go to x: -200 y: -120
switch backdrop to [day v]

forever
    move (10) steps
    wait (0.2) seconds
    next costume

    if <touching [edge v] ?> then
        next backdrop
        go to x: -200 y: -120
    end
end
  • The sprite walks
  • Changes costumes → walking animation
  • At end → background changes → resets to start

3. Add Sun Sprite — With Glide Motion

  1. Add Sun sprite
  2. Resize to around 50%
  3. Move to starting position (bottom-left)

Sun Code (Day Appearance + Glide Sunrise–Sunset)

when green flag clicked
if <backdrop = [day v]> then
    show
else
    hide
end

go to x: -240 y: 40

forever
    glide (2) secs to x: -160 y: 80
    glide (2) secs to x: -80 y: 120
    glide (2) secs to x: 0 y: 160
    glide (2) secs to x: 80 y: 120
    glide (2) secs to x: 160 y: 80
    glide (2) secs to x: 240 y: 40
end
  • Smooth sunrise → peak → sunset
  • Follows natural arc

4. Create Moon Sprite

  1. Paint a circle
  2. Fill with gray/white
  3. Name “Moon”

Moon Code (Night Appearance + Glide)

Same as sun but reversed:

when green flag clicked
if <backdrop = [night v]> then
    show
else
    hide
end

go to x: -240 y: 40

forever
    glide (2) secs to x: -160 y: 80
    glide (2) secs to x: -80 y: 120
    glide (2) secs to x: 0 y: 160
    glide (2) secs to x: 80 y: 120
    glide (2) secs to x: 160 y: 80
    glide (2) secs to x: 240 y: 40
end
  • Appears during night
  • Follows same path

5. Add Ambient Music

Choose sound → Xylo3

when green flag clicked
forever
    play sound [xylo3 v] until done
end

6. Brightness Effect (Sunrise → Sunset → Moonrise)

Switch backdrop → Change brightness

when backdrop switches to [day v]
set [brightness v] effect to (0)
wait (7) secs
change [brightness v] effect by (-25)

when backdrop switches to [night v]
set [brightness v] effect to (0)
wait (7) secs
change [brightness v] effect by (25)
  • Sunset dims
  • Moonrise brightens

7. Stars — Twinkling Effect

  1. Choose star sprite
  2. Duplicate 2–3 times
  3. Place randomly

Stars Code (Night Only + Twinkle)

when backdrop switches to [day v]
hide

when backdrop switches to [night v]
show
go to (current-position)

forever
    set [ghost v] effect to (0)
    repeat (100)
        change [ghost v] effect by (10)
        wait (0.1) secs
    end
    repeat (100)
        change [ghost v] effect by (-10)
        wait (0.1) secs
    end
end
  • Twinkling stars
  • Appear only at night

Final Output

  • Walking character
  • Day → Night → Day loop
  • Sun + Moon movement
  • Stars twinkling
  • Brightness shifts
  • Background music

🎥 Watch the full guide step-by-step: How to Make Day & Night Animation in Scratch | step by step full tutorial by Kodex Academy

Enhancement Features (Advanced)

Here are optional bonus upgrades you can add:

1. Clouds Floating Animation

when green flag clicked
forever
    glide (5) secs to x: 240 y: 160
    go to x: -240 y: 160
end

2. Day/Night Speed Control (Add Slider)

Add variable: speed

when green flag clicked
set [speed v] to (2)

forever
    glide (speed) secs to x: ...
end

3. Automatic Weather Change

Random brightness flicker:

forever
    change [brightness v] effect by (pick random (-10) to (10))
    wait (0.2) secs
end

4. Background Animals (Birds Moving)

when green flag clicked
forever
    move (10) steps
    if <touching [edge v]> then
        go to x: -240 y: 40
    end
end

Additional Helpful Links

PurposeLink
Scratch Websitehttps://scratch.mit.edu
Download Scratchhttps://scratch.mit.edu/download
Free Background Imageshttps://pexels.com
Free Graphicshttps://pixabay.com

Complete Project Summary

This Scratch day–night animation tutorial gives beginners and intermediate learners the power to bring realistic environmental effects inside their Scratch projects.

You learned:

  • Costume animation
  • Gliding sprites
  • Backdrop switching
  • Brightness adjustments
  • Twinkling stars
  • Background sound

These can easily be integrated into:

  • 🎮 Games
  • 📖 Stories
  • 🎥 Animations
  • 🖼 Background environments

Conclusion

Creating a day and night animation in Scratch is a fun and rewarding way to explore the possibilities of visual storytelling and game design using simple block programming. With just a few sprites, backdrop transitions, brightness effects, and glide animations, you can build a dynamic world where the sun rises and sets, the moon glides through the sky, and stars shimmer beautifully at night.

This project not only helps beginners understand key Scratch concepts like motion, looks, loops, and events—but also inspires creativity for building more advanced Scratch games, stories, and backgrounds. From walking characters to twinkling stars, each element enhances the scene and makes it more engaging and realistic.

You can continue improving your animation by adding features such as moving clouds, background weather effects, or interactive gameplay elements. These enhancements help transform a simple animation into a complete Scratch game environment.

Call to Action

  1. Don’t forget to check out the full video tutorial: How to Make Day & Night Animation in Scratch | step by step full tutorial by Kodex Academy
  2. Like, comment & share the video
  3. Visit kodexacademy.com
  4. subscribe to the Kodex Academy YouTube channel for deeper Scratch content.

Happy coding with Kodex Academy! 🚀

Learn More with Kodex Academy

At Kodex Academy, we’re passionate about helping students learn coding in creative ways. This project teaches more than Scratch—it empowers young minds to build tools that work in the real world.

Explore more:

Stay updated with new content, free tutorials, and coding challenges!

Further Reading & Links

Recent Posts

How to Create a Health Bar Animation in Scratch: Healthy vs. Junk Food Game Tutorial

How to Make a Health Bar in Scratch | Healthy vs Junk Food Game | Scratch Animation | Kodex AcademyCreating fun and engaging games in Scratch not only helps kids learn coding, but also encourages...

How to Create a Basketball Game in Scratch: Full Step-by-Step Tutorial (Moving Hoop, Jumping Ball & Scoring)

Are you ready to create an exciting basketball game in Scratch with a moving hoop, jumping player, and real-time scoring? This step-by-step Scratch game tutorial is perfect for beginners who want to...

How to Make 3D Shapes in Scratch – Draw Cubes, Pyramids & Cylinders Using Pen Extension

If you’ve ever wondered how to make 3D shapes in Scratch or create 3D geometry using code, you’re about to dive into a creative world of math, animation, and programming fun. Learn how to make...

How to Make Flappy Bird Game in Scratch | Coin Collection Game in Scratch | Scratch Coding for Beginners

Have you ever wondered how people create fun games like Flappy Bird without writing a single line of code? With Scratch programming, anyone — from complete beginners to young creators — can build...

How to Make Day & Night Animation in Scratch (Step-By-Step Full Tutorial)

If you’ve ever wondered how to make day and night animation in Scratch or wanted to bring your stories and games to life with realistic sky transitions, this tutorial is perfect for you! Scratch is...

How to Make a Shooting Game in Scratch | Jet Shooting Game Tutorial (Step-By-Step Guide)

Introduction - Jet Shooting Game in Scratch Scratch Tutorial Game | Scratch Game Tutorial Easy | Scratch Programming Games | Jet Shooting Game in ScratchWant to build your first arcade-style...

Top 5 Animations in Scratch: Jump, Bounce & Fly (Beginner Tutorial + Code)

In this step-by-step guide, we explore the Top 5 animations in Scratch games that will make your projects smoother, interactive, and fun to play. You’ll learn: ✅ How to make a sprite jump ✅ How to...

How to Make a Tic-Tac-Toe Game in Scratch – Easy Scratch Tutorial for Beginners

We are going to build the all-time favourite logic game in Scratch: Tic‐Tac‐Toe. In this game two players take turns making X and O on a 3×3 grid. The first one to get three in a row — across, down or...

How to Make a Real-Time Wall Clock in Scratch | Step-by-Step Scratch Tutorial

If you’ve ever wondered how to make a real-time wall clock in Scratch, you’re in the right place! In this step-by-step Scratch tutorial, we’ll show you how to build a fully functional analog clock...

How to Make a 3-Level Platformer Game in Scratch | Mario-Style Hen Adventure Game

Have you ever wanted to build your own Mario-style platformer game in Scratch? This step-by-step guide will walk you through how to make a 3-level platformer game in Scratch — featuring a jumping hen...

How to Make a Math Racing Game in Scratch | Game Concepts and Complete Tutorial

In this tutorial, you’ll learn to build a Math Racing Game in Scratch. Players solve math problems to move their character forward; wrong answers benefit the opponent. It’s a race of speed, accuracy...

How to make Memory Skill Game in Scratch | Card Matching Game in Scratch – Part 2 | Step-by-Step Coding

In this tutorial you'll learn how to make memory skill game in Scratch / card matching game in Scratch. This is a great beginner‑to‑intermediate project for scratch tutorial game, scratch programming...

How to make a Card Matching Game in Scratch | Memory Skill Game in Scratch – Part 1 | Step-by-Step Coding

In this Scratch tutorial, we'll walk you through how to make a card matching game in Scratch, also known as a memory game or skill game. This is a popular beginner project that introduces essential...

Create a Quiz Game in Scratch | Spelling Test in Scratch | Picture Identification in Scratch

Want to make learning spelling fun, visual, and interactive? In this Scratch tutorial, you'll learn how to make a spelling quiz game in Scratch using picture identification, text-to-speech, and...

How to make a Double Jump Game in Scratch | Platformer game in Scratch | Step by Step Coding

How to make a Double Jump Game in Scratch. Scratch is a fantastic platform for beginners to learn programming by making games, animations, and interactive stories. Among the many kinds of games...

How to Use Variables in Scratch | Variable Blocks in Scratch | Complete Tutorial

Introduction: Variable Blocks in Scratch Whether you’re just getting started with Scratch programming or looking to take your projects to the next level, understanding variables and lists is...

How to Make Earth Revolve Around the Sun in Scratch: A Complete Tutorial & Enhancements

Animating Earth revolving around the Sun is a classic beginner/intermediate Scratch animation project. It combines trigonometry (sine & cosine), variables, loops, and visual scripting. Kids can learn...

How to Make a Game in Scratch | Snake Game in Scratch | Step-by-Step Game Coding

In this tutorial, we’ll build a Snake Grid style game in Scratch step by step (very similar to the Kodex Academy example). By doing this, you’ll cover many of the core Scratch building blocks. We will...
Scroll to Top