To implement Shark attack game in Scratch a step wise procedure is as follows:
1. Click on new sprite option and add one shark, one octopus, one yellow fish, and six polka dots sprites.
2. Select the Shark sprite and click on the scripts tab and write the script given below for the Shark sprite.
Shark code in Scratch
3. Select the Octopus sprite and click on the scripts tab and write the script given below for the Octopus sprite.
Octopus code in Scratch
4. Then one by one select the Polka dots sprites and add the following script for each of them.
Scratch code for polka dot fish Sprites
5. Lastly, code for the yellow fish is as given below.
6. Click the green flag to run the game.
7. Click on the new backdrop option and add a underwater3 backdrop from Nature category.
A pdf of the given tutorial is here. Shark Attack