Moving on from the basic commands that I learnt how to do (see previous blog), I was actually excited to use my creativity to produce something more advanced from what I have learnt. I found a shark eating game when looking through the already produced scratched programs and I decided to have a go at making a simple fish eating game. The objective is to control the main character which is a shark with the mouse to move around the aquarium eating fish.
My 4 year old son loves this game. Here is how to produce it.
1. Click on the ‘Stage’. In the central column click on the Background tab. Click the edit button. Use the toolbar to create a suitable underwater background. Then click on ok.
How to make the Shark
1. click on the folder button. Then choose the animals folder select shark 1-a and click ok.
2. While on shark 1-a click on the costumes tab. Then import and select shark 1-band click ok. (If you have done this correctly you will have one ‘sprite’ but that one sprite will have two costumes.)
3. Give your shark the script shown above. A TIP: click the double headed arrow button or the shark will go upside down.
Inserting an Edible Fish
1. click on the folder button. Choose a suitable fish, and click ok. You can then you the tool bar to resize the fish.
2. Insert the following script
3. When inserting the orange variable command, you will need to create the variable yourself. The variable name will appear on the scoring system. I did something simple like “eaten”.
1. right click on a fish with a script and duplicate. This will save you re-doing the code every time. I also changed the number in the step part of the code to make the fish swim quicker or slower depending on the number.
Adding an Octopus
1. I used the above script for my octopus. I also included that when the octopus is eaten the points will set to zero.I made the octopus move around randomly, by pointing in a set direction and added in bubble sound as well.