Fishy Lesson

Step 1
Go to this link: and upload it to Scratch.
Step 2
Go to costumes, duplicate the fish costume and make another costume with a different tail.
Step 3
Add this code to your fish to make the tail move.

Step 4
Change the fish's rotation style to left-right.

Step 5
This is what it should look like when you run the game.
Step 6
Add this code to your fish sprite to make it move to the right smoothly.
Step 7
Finish the rest of the movement scripts the same way.

Step 8
Now that we can move, upload this backdrop
Fish backdrop
Step 9
Make two variables, call them Fish eaten and Playersize, we will use these later.

Step 10
Add this code to the Fish sprite. It makes the fish appear in the center, and sets the variables to default values.

Step 11
Duplicate the fish and call it enemy then delete all the scripts on it.
Step 12
Add this code to the Enemy sprite, this will create enemies every few seconds.

Step 13
Add this to the Enemy sprite as well. We already made the other costume.

Step 14
Make a new variable, call it speed.

Step 15
This code will randomize the size and speed of the enemies.
Step 16
Now make a define block for Speed/Size of the cloned fish so we can change it without messing up the others.
Add a number input
Add a label input
Add a number input

Step 17
Put in size and speed into the number inputs.
Step 18
This is what you should have so far on the enemy sprite.

Step 19
Add this code to the define block. We are setting up for the next step
Step 20
Add this to the define block. It chooses a random side for enemy to appear.

Step 21
Add this to the existing blocks. The speed of each cloned fish will be different now
Step 22
Add in an if-then-else block for if player size is greater than that particular enemies size.
Step 23
This code will increase the player's size relative to the fish's and also change the score.

Step 24
Make the broadcast message "player eaten" and add it in
Step 25
Add this code to delete the enemies when they reach the edge.
Step 26
This is what all of our code should look like on the enemy sprite.

Step 27
Add a new backdrop, this will be for when the game is over.

Step 28
Go back to the regular fish sprite.
Step 29
Add this code in to the regular fish sprite.

Step 30
This is what my finished game is like. If you want to change anything ask an instructor! Eat the smaller fish and avoid the bigger ones!
Fishy Lesson Info


MVCode Clubs

Created By

Missing tiny anmacdonald

Access Level


For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach