Smooth Scratch Movement

by pakku1029 in Circuits > Websites

646 Views, 0 Favorites, 0 Comments

Smooth Scratch Movement

scratchs.png

Hey! I'm pakku1029, and this is my first Instructables! In this lesson, we'll learn how to create smooth movement in Scratch!

Supplies

Scratch | a brain

Player Sprite

Screenshot 2023-10-12 9.48.41 PM.png

Create a player sprite. Select from the costume library or paint one yourself.

Variables

Screenshot 2023-10-12 9.51.59 PM.png
Screenshot 2023-10-12 9.54.07 PM.png

Create a new variable for your player sprite. Name it "speed x". Then, set it to zero on green flag. (see above)

Movement Setup

Screenshot 2023-10-12 9.56.00 PM.png

Then, make a new Custom Block. Add a label, "move x". Then add an input, "key x". Then turn on run without screen refresh. If stuck, follow the image above.

Movement

Watch the video for the code for the custom block.

FINISHED!

Ta-DA!!! Now put both these scripts into your backpack, so they work in any game!