This project features a hilly bridge that the bike must cross to explore the desert landscape. As the player presses the right arrow key, the bike moves forward, and the tyres change costumes to simulate rolling. The bridge has ups and downs, so the bike’s speed increases as it goes downhill, and sound effects of wind rushing past enhance the experience. Students will practice using repeat loops to create continuous movement while ensuring the bike does not fall off the bridge.
These are the high level steps to create this project. Try to create the project on your own first as much as possible, before checking the detailed solution samples below.
This section provides detailed, step-by-step instructions on how to build the project. There are many ways to create a project, so feel free to explore different approaches. Please note that these instructions are Al-generated, so errors may occur and the coding blocks may not map to Scratch exactly. But it should serve as very valuable references. Stay attentive as you follow along, and enjoy!
Start by selecting or creating a backdrop that resembles a hilly bridge. You can use Scratch's built-in backdrops or draw your own. Then, add three sprites: BIKE BODY, FRONT TYRE, and BACK TYRE. Position them so that they form a complete bike, with the tyres aligned with the bike body.
Use the 'when right arrow key pressed' block to start the movement. Inside this block, use a 'repeat until' loop to move the bike forward. The loop should contain 'move 10 steps' and 'change x by 10' blocks to simulate the bike moving across the bridge. Adjust the steps to fit the scale of your backdrop.
For both the FRONT TYRE and BACK TYRE sprites, use a 'switch costume' block to change their appearance, simulating rolling. Use a 'next costume' block inside a 'forever' loop to continuously change the tyre's appearance as the bike moves.
Use 'if' statements to check the bike's position on the bridge. If the bike is on a downhill slope, increase its speed by changing the number of steps it moves forward. Use 'change x by' blocks to adjust speed based on the bike's y-position or a specific backdrop feature.
Include sound effects to enhance the adventure. Use the 'play sound until done' block to add wind sounds when the bike is moving. You can find suitable sounds in the Scratch library or upload your own.
It is common to have bugs in the code. Here are some of issues you might run into.
Enroll your child in award-winning online Scratch coding classes led live by experts and designed by professionals from Google, Stanford, and MIT.
The challenge continues: Enjoy even more Scratch tutorials dreamed up by other students or use your imagination to make your own!
Explore your child's grade level to find computer science classes and learning pathways that set your student up for success.