Welcome to our exciting Scratch project, 'Pattern Snake'! In this project, we will create a fun and colorful snake pattern that follows your mouse pointer around the screen. You will learn how to draw a sprite, make it follow your mouse, create clones, change colors, and add costumes for different shapes. By the end of this project, you will have a stunning visual snake pattern that you can show off to your friends and family. Let's get started!
Go to the Scratch website, create a new project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
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.
You can create your own sprites using the sprite editor. To create a new sprite put your mouse over the Choose a Sprite button and then click on the paintbrush.
This create a blank sprite and will open the sprite editor where you can use the tools to create your sprite. You can even create extra costumes for your sprite!
Tip: give your sprite a name so that you can recognise it in the code blocks.
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
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