
Try Penalty Shootout Challenge for fun Scratch Project!
Penalty Shootout Challenge
Platform: Scratch
Level: beginner
In this project, the soccer player character will attempt to shoot the ball into the goal. Students will program the player to move left and right using arrow keys. Once the player is in position, pressing the space bar will make the player kick the ball towards the goal. If the ball reaches the goal, a 'Goal!' sound will play, and the player will switch to a victory costume.
Backdrop And Sprite Images For The Project


Penalty Shootout Challenge: Solution Outline
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.
- Create the soccer player sprite and set up its initial position.
- Program the player to move left and right using arrow keys.
- Program the player to kick the ball when the space bar is pressed.
- Detect if the ball reaches the goal and play a sound.
- Switch the player to a victory costume upon scoring a goal.
Penalty Shootout Challenge Sample Solutions
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!
Begin by selecting a soccer player sprite from the Scratch library or drawing your own. Place the sprite at the bottom center of the stage to simulate the starting position for a penalty kick. This will be the player's initial position before moving left or right.
Use the 'when key pressed' blocks to allow the player to move left and right. Attach a 'change x by' block to move the sprite horizontally. For the left arrow key, use a negative value, and for the right arrow key, use a positive value.
Use the 'when space key pressed' block to trigger the kick action. You can simulate the kick by moving the player sprite upwards and then back down to its original position. This can be done using a 'repeat' block to create a smooth kicking motion.
Create a goal line using a sprite or a backdrop. Use a 'if touching' block to check if the player sprite (or a ball sprite if added) touches the goal line. If true, play a 'Goal!' sound and switch the player to a victory costume.
Ensure the player sprite has a victory costume ready. When the goal condition is met, use the 'switch costume to' block to change the player's appearance to celebrate the goal.
Common Potential Issues in Penalty Shootout Challenge Project
It is common to have bugs in the code. Here are some of issues you might run into.
- Ensure the player sprite doesn't move off the screen by adding boundary conditions.
- Make sure the 'Goal!' sound plays only once per goal by using a conditional check.
- Check that the player returns to the original costume after the victory celebration.
Extra Challenges For Penalty Shootout Challenge
- Add a goalkeeper sprite that moves randomly to block the ball.
- Create a scoring system that keeps track of goals scored and missed.
Learn Scratch Coding Skills
Enroll your child in award-winning online Scratch coding classes led live by experts and designed by professionals from Google, Stanford, and MIT.
Scratch Junior
Grades K-2
Scratch Ninja
Grades 2-6
Accelerated Scratch
Grades 5-9
Intermediate Game Building with Scratch
Grades 3-6
Explore More Fun Scratch Practice
The challenge continues: Enjoy even more Scratch tutorials dreamed up by other students or use your imagination to make your own!
Find Best Classes For Your Child
Explore your child's grade level to find computer science classes and learning pathways that set your student up for success.