Scratch Arts
Advanced
45 mins
Teacher/Student led
+115 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Pattern Snake

Create stunning visual snake patterns by moving your mouse.

Teacher Class Feed

Load previous activity

    1 - Create a new Scratch project

    Go to the Scratch website, create a new project and delete the cat sprite.

    scratch.mit.edu

    2 - Draw a sprite

    In this project we will draw a sprite and then code it to follow our mouse around the screen and create a trail behind it with some added effects.

    Create a new sprite and draw a shape. It can be any shape and any colour you like. Keep it small and drag it into the center of the box.


    3 - Follow you mouse pointer

    To make the snake pattern we will code the sprite to follow your mouse around the stage area.

    Add the following code to the sprite to make it start at a random position and then follow your mouse pointer.

    when green flag clicked go to (random position v) forever move (10) steps if on edge, bounce point towards (mouse-pointer v) end

    Click on the green flag and your sprite should follow your mouse around.


    4 - Create clones

    To make the trailing snake effect we will create clones of our sprite, leave them where they were created and then delete them after 5 seconds.

    Add the following new code blocks to your sprite.

    when green flag clicked go to (random position v) forever move (10) steps if on edge, bounce point towards (mouse-pointer v) create clone of (myself v) // add this block end when I start as a clone // add these blocks wait (5) seconds delete this clone

    Click on the green flag and the clones should make a snake effect before deleting after 5 seconds.


    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2026. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more