Goal:
We want our shark sprite to look to the left when moving left (Costume 2), and to the right (Costume 1) when looking right.
Once we code this it will look a lot better! But we’re still gonna add a little more to this.
Steps:
- Still on the “Sharky” sprite, add the following to our existing code.
- From Looks, place a switch costume to block.
- From Variables, place a nextCostume block into the switch costume to block.
- From Variables place a set to block inside the “if key left arrow pressed” block.
- Change it to nextCostume and the number to 2.
- From Variables place a set to block inside the “if key right arrow pressed” block.
- Change it to nextCostume and the number to 1.