Goal:
The fish will be swimming at different speeds and it has two different costumes that make it look towards the left or towards the right.
When the game starts, we will set the fish to be looking towards the right.
We also need to set our speed variables to pick a random speed to travel at when the fish spawns into the game.
Lastly, if the fish is moving to the left (the negative x direction), we want the costume to change and make the fish look towards the left.
Steps:
- Stay on the “Fish” sprite.
- From Events, place a when green flag clicked block.
- From Looks, place a switch costume to and change it to fish2.
- From Variables, place a set to block and change it to xSpeed.
- From Operators place a pick random block inside the previous block and set the numbers to -10 and 10.
- From Control, place an if block.
- From Operators place a < block.
- On the left side of the < block, place a round xSpeed block from Variables.
- On the right side of the < block set it zero.
- From Looks, place a switch costume to block and change it to fish3.
- From Looks, grab a show block and place it outside of the if statement.