Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

2. Lo sprite volante


In this step, you’ll make many sprites glide across the window. Breaking down a big problem like this into steps makes it easier to solve. The starter project you opened contains a storefront sprite. Later, you will learn how to move the storefront so it looks like the flying sprite is behind it. For now, the flying sprite will fly in front of the storefront.

To begin, click on the sprite you chose to be the flying sprite.

Similar to how you started Fashion walk, drag the flying sprite to a starting position on the far left of the screen. Add a "go to" block, which will automatically fill with the correct x and y coordinates. Drag the sprite to where it will end its flight on the right side of the screen. Then, add a “glide” block. Click on the code stack to test it. The sprite should appear on the left of the screen and glide to the right.

The sprite needs to fly across the window forever when the flag is clicked, so add a "forever" loop and a "when flag clicked block." Try that out. The sprite should fly across the screen over and over when the flag is clicked.

If you have a question, your neighbor or your Guru might know the answer.

Now, it's your turn: Drag the flying sprite to the left side of the screen, and add a "go to" block. Drag the flying sprite to the right side of the screen, and add a "glide" block. Add a "forever" loop and a "when flag clicked" event to make the sprite move across the screen forever when the program is run.

arrow_backward Indietro
Avanti arrow_forward
  1. Programma una posizione di avvio e di arresto per lo sprite.
  2. Fai volare ripetutamente lo sprite da una parte all'altra dello schermo.