Fishy Lesson

Step 1
Go to this link: http://i1215.photobucket.com/albums/cc512/drew2777/fish_zps277cbeb3.png 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.
Temp1406687893

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

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.
Temp1406688172

Step 8
Now that we can move, upload this backdrop http://i1215.photobucket.com/albums/cc512/drew2777/fishbackdrop_zps12ae14d7.
Fish backdrop
Step 9
Make two variables, call them Fish eaten and Playersize, we will use these later.
Temp1406688976

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

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.
Temp1407193335

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

Step 14
Make a new variable, call it speed.
Temp1407200763

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.
Click
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.
Temp1407201903

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.
Temp1407286248

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.
Temp1407285535

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

Account

MVCode Clubs

Created By

Missing tiny anmacdonald

Access Level

public

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