Scratch is one of the most popular programming languages for kids. It uses pre-built, colorful code “blocks” that click together like LEGOs to form scripts, allowing kids to learn computer science concepts through hands-on development of their own games, digital art, and animations. Kids create scripts from blocks to animate sprites, or in-game characters and objects, to move, change, and interact with each other.
If your child loves to program in Scratch, or if they are a fan of platforming games, learning how to create jump sprites is a key skill they should learn. While making characters walk back and forth on the screen is relatively easy, learning to make sprites jump and interact with objects in Scratch requires careful coding and is an intermediate skill when it comes to game design. So today, we’re going to walk you and your kid through how to create a sprite jump in Scratch.
Enroll your kids in this free, award-winning online Scratch coding class designed by experts from Google and MIT to help them build creativity and computational thinking while creating cool games and animations.
How to Make a Jumping Sprite From Scratch in a Simple Way
Remember that there are two questions to ask when creating a program: 1. “Does the program work the way I want it to?” 2. “Is it well designed?” The first question is easy to answer: a program that doesn’t work can be described as “broken” and may contain one or more bugs that prevent the game or program from running as intended. The second question is a little more difficult. We can design simple programs that perform basic tasks fairly easily, but making things work elegantly, simply, and efficiently can be much more difficult. We’ll first outline how to create a sprite jump only in Scratch, and then we’ll show you a more advanced way to do it that involves simulating gravity while falling.
1. Soil Paint
Start this project by selecting a sprite as your player character. Then you want to use the brush in the “Sprite Options” pop-up menu in the bottom left corner. This will allow you to use the rectangle tool to create multiple platforms for your sprite to stand on. Here we have selected a dinosaur sprite and a mud colored square sprite as my land.

2. Create a Variable “Y Speed”.
Viewing the Stage window in Scratch as a Cartesian Plane, the Y-axis determines the vertical location of the sprite in the stage. When a character moves up from its starting position, its Y value increases, and when a character moves downwards, its Y value decreases. So we want to associate a key press on the keyboard with an increase in the Y value of the sprite. However, this value can change depending on the location of the Ground sprite or its shape, for example if there are ramps, holes or obstacles that need to be jumped over. When we have a value that changes in a program, we must use a Variable that will store that value at all times.

3. Create Gravity
Now that we have the variable yVelocity, we can use it in a loop to create the sensation of gravity. By setting the variable to -1 and placing the variable with the “Change y by __” block, it makes the Character sprite appear as if it were down. By creating a condition in our loop that resets the variable to zero when it hits the ground color. If you use the mouse to position your sprite on the ground and click the green flag, the sprite will fall and stop. Use the color sensor inside the Sensing block to get the right color and shade of the base block.
4. Jump
Now, you have to create a series of parallel blocks that activate when pressing a key on the keyboard. Use an Event block for this, then by setting the Y value to 10 every time the Space key is pressed, my Y value suddenly goes up, but because of the previously created “gravity” string, our action always encounters a decrease after the jump.
5. It works, but is it well designed?
It’s not perfect, but it works. It’s a simple jump. If you play around with the code at this stage, you’ll notice some features that might not make the game great. For example, if I hold down the Spacebar, the dinosaur will still jump and basically fly. If I double tap, he does a bunch of jumps. And instead of standing on the ground, my sprite was floating in the middle of the platform and vibrating very little. There are no other controls, no background, no music, it feels a little buggy.
How to make Sprites jump in Scratch creatively
We want to add some other features later, but most importantly, we want our sprites to feel the environment changes, not just be the same platform in the same location forever. If you add some other sensing conditions for moving left and right, you have the basic mechanics of a platformer game, which is a powerful tool for kids who love coding and gaming learning. Keep reading if you want to know how to create jump sprites in Scratch in a more elegant way.
1. Follow steps 1 and 2 from above
In this more challenging version, we will create ground sprites, character sprites, and ay variables to create platforms and a sense of gravity in our game.

2. Gravity is Constant, But Coding Is Not
The main bug in our first program was that gravity was not fully implemented. If the player holds down the space bar, the jump will last forever, which may be part of your game, but will probably make it too easy and not very fun to play because it ignores the Law of Gravity.
Gravity is the attractive force of an object. Every giant galaxy and every tiny particle in the universe has a certain gravity, but objects with greater densities such as stars, planets, and black holes emit a stronger gravitational force, which pulls humans and monkeys toward Earth as we jump, Earth, and other. the planets of the Solar System toward the sun, and the Solar System itself toward the supermassive black hole at the center of the Milky Way. Without an equivalent or stronger force to defy gravity, such as the muscular strength of a human jumping or the rocket engine that propels a space shuttle into space, there would be no jumping, flying, or even walking.

3. Play around with the Y Variable
In this version of the game, we have the same idea in our basic loop: a variable y, a “change by y” block, and a conditional in the forever loop that detects something. This version is different because instead of feeling the color, you can feel the Sprite itself. Now your lands can vary in color, pattern, or even costumes (giving you sprites that are very different from your Lands), which makes the game more interesting and easier to change later by simply adding new costumes to the sprites. In this version, instead of always falling, the Character sprites are held on the ground like gravity keeps us walking on the road instead of flying in the air. Also in this version, we have included a command using the Space key as a conditional in a forever loop, instead of a separate code string. We could say it’s simpler, but both methods work. Experiment to see which works better for you.

4. Create a SitStill block
At this point, you may notice bugs present in the simple version above. The character jumps because the y value changes when you press the space bar, and then falls due to the use of different variable settings, but the sprite shakes slightly when standing on a platform. Open the “Block Me” menu on the left side of the screen. Then “Create a block” which you can name, “SitStill.” Make sure to click the box that says, “Run without screen refresh.” Now, using the conditional block and the “No” operator as well as the sensing block, we will adjust the Y value such that it is always between 1 and -1 when it hits the platform. The math is a little complicated, but when you place a SitStill block inside your main Forever loop, your rest sprite will be more stable.


Why Jump At The Start?
In game design, we create boundaries and obstacles for our characters, and the best games create meaningful conditions for both winning and losing, which must be fair, easy to understand, and feasible for most players. Since jumping, in addition to directional movement, is the most important part of most platformer games, you want your players to be able to predict how those constraints work so they can develop skills and feel engaged with the game’s challenges, rather than ignoring them. the most powerful force in the universe.
Type of Scratch Game That Uses Jumping
Now that you can jump, you can create other touches in your game such as music, forward and backward movement, and perhaps use different shapes and sizes for your platforms or tricky puzzles. The fact is, if you want to make games, learning how to jump is an essential skill for any type of game.
- Jumping game: Make the various floating platforms generated as clones and move across the screen from right to left.
- Shooting game: Rather than simply moving through obstacles, in shooting games, characters must defend themselves, jump to avoid being hit, and potentially fight back.
- Adventure game: Most adventure games and some RPGs include the ability to jump, and many make jumping a changing variable that increases as the player progresses.
- Racing game: Even in some racing games, such as the very popular Rocket League, players have the ability to jump, making the game unpredictable compared to other car games.
Make the Sprite Jump at the Beginning
That’s it for our tutorial on how to make a Sprite jump in Scratch. If you want, you can check out YouTube tutorials for more help on this kind of project, as well as helpful tips and tricks to avoid bugs. Next, learn how to create a clicker game in Scratch. Enroll your child in Create & Learn’s free, award-winning Scratch class, where professional developers can guide your child through the process of designing their own games and apps. They can even get a certificate!
Written by Bryan Gordon, Create & Learn instructor. After ten years working as an English teacher, Bryan began studying Mathematics and Computer Science over the past few years. In addition to writing and teaching, she enjoys cooking, gardening, playing guitar, and hanging out with her cats, Baguette and Wally.
Gaming Hub
Game online adalah jenis permainan video yang dimainkan melalui jaringan internet. Game ini memungkinkan pemain untuk berinteraksi dengan pemain lain secara real-time, baik itu dalam bentuk kerja sama, kompetisi, atau eksplorasi dunia virtual bersama-sama.