Step 6 – Catch the fish:
We need to let the Shark catch the Fish.
This code goes on the Fish sprite.
- Towards the bottom of the Forever block add in an IF – THEN block
- In the IF section, use a light blue touching mouse pointer block
- Change mouse pointer to be the Shark 2 sprite - use the drop down
- Add a purple hide block to hide the fish when this happens
That should hide the Fish when it's been caught by the Shark. Run the program to make sure.
Show the fish at the start
We need to reveal the Fish at the start of the game! Otherwise when you run it the Fish won't appear.
- Add a purple Show block above the Forever part of the Fish code to make the sprite visible at the start of the game
- Add a blue go to random position block above the Forever block as well. This will randomise where the fish starts
You could add the same sort of thing to the Shark or set the shark to always start in the same place (perhaps x: 0 y: 0).