# how to make a sprite loop in code org

In the last level you slowed down the car with the sprite.velocityX block and the counter pattern. What looks most realistic to you? You can tell it to move, turn, and check whether it has bumped into another sprite. You'll make the left arrow work in the next level. In particular students will learn how to simulate gravity, make a sprite jump, and allow a sprite to float left or right. Run your code to see how it works. Do you think learning to program always means learning new commands? We know that loops allow us to do things over and over again, but now we’re going to learn how to use loops with extra structure built right in. Ask students to discuss with a neighbor and remind one another what each of these four constructs is used for and how they work. Encourage students to take seriously their predictions before actually running the code. Use sprite velocity with the counter pattern to create different types of sprite movement, Explain how individual programming constructs can be combined to create more complex behavior, Use the counter pattern with the sprite's velocityX property to make the car speed up. A sprite is the name we give to a collection of values in Game Lab that represents a character in a story, animation, or game. Have students focus not just on how the game works, but what the code to create that kind of functionality looks like. Test your code before moving on. It almost looked like the car was getting pulled to the left. For starters you'll make a simple jump, and then make it more realistic looking in the next level. On the second list write down all the new blocks you learned today. Using the counter pattern with a sprite's x and y property makes a sprite move smoothly across the screen. In this game the player will collect points to increase the score. In the Animation Tab there is already a coin animation. The car is going to run into the water! For Loop Fun. Challenge: Add code that makes the car slow down only if his velocityX is greater than 0. A sprite is the name we give to a collection of values in Game Lab that represents a character in a story, animation, or game. When you're finished, you can click to send your creation to a friend, or to send it to your Projects Gallery. Students are encouraged to make their own additions to the game in the final level. Creating a Sprite. This makes the sprite speed up. We're going to keep learning a few more tools in Game Lab, but as we do remember what we saw today. Students will be combining multiple programming constructs, including the velocity properties, the counter pattern, user interaction, and collision detection.