This code snippet can be used to make your character appear to dig into the ground. It also uses the ‘random movement’ snippet as shown on the right.
When you click the Green flag the sprite will start drawing a line, making it look like it’s digging.
You have to make sure that the pen size is around the same size as the sprite size.
The code can be found here: https://scratch.mit.edu/projects/389833808/