🏠
Section 1.

In the game so far, our sprite always faces the same way.
Let's add code so that:

Also, we will code that when it is going up and down the sprite doesn't change which way it is looking.

To do this we need our sprite to have a costume that faces to the right and another costume that faces to the left.

We were careful when we started to choose a sprite that does have a costume facing sideways.

Most sprites only have costumes facing in one direction.

We will use one of these costumes to create a costume that faces the other way.

Section 2.

How to Create the New Costume

The first two steps are:
  1. Change the name of the costume you are currently using so that the name says if it is facing right or left.
  2. Then use the copy button to copy it

Section 3. The next steps are:
  1. Go to the Costumes tab
  2. At the bottom left of the screen there is a 'Paint' button
  3. Click on the paint brush. This creates the space to paint a new costume.
  4. Use the 'Paste' button to paste the sprite into this space
  5. Use the 'Flip horizontal' button to make it face the other way
  6. Change the name so that it says which way it is facing
Section 4.

The next step is to add some more code.

In the setup block you say which costume you want to start with.
You can also use the 'set size' block if you need to change the size of your sprite.

In the main loop, the code for the right arrow needs to switch costume to the one that faces right.

The code for the left arrow needs to switch the costume to the one that faces left.

Test your game.
Does your sprite always face the way it is moving across the stage?
Check that it doesn't change which way it is facing when it goes up and down.

This is what we wanted, so this section is finished.

🏠