6. Eat fish

In this practice we are going to play a game that consists of chasing fish with a penguin so that it eats them.

_images/scratch3-p05-comiendo-peces.png


  1. We start the Scratch editor.


  2. Press the language button boton-idioma in the top bar and choose English.


  3. Press the tutorial button boton-tutoriales and then the "Games" button.

    We select the tutorial "Create a chasing game" and visualize it.

    In this tutorial we will see the basic operation of the program.


  4. We delete the cat object by clicking on the trash can icon.

    borrar-gato


  5. Now we are going to carry out the program. First we select a backdrop for our game. In the button select backdrop seleccionar-fondo we choose one from the bottom of the sea "Underwater".


  6. Next we add a fish. Clicking select object seleccionar-objeto in the Animals tab we select a fish that we like.


  7. Now we are going to move the fish around the screen randomly. To achieve this we program the following instructions.

    _images/scratch3-p05-pez-mover.en.png


  8. Press the green flag bandera-verde to test the operation of the program.


  9. We added a new character that will chase the fish to eat it. Clicking select object seleccionar-objeto in the Animals tab we select a penguin.


  10. We create a new variable. In the button variables boton-variables we press "create a variable" and call it points.

    _images/scratch3-crear-variable-puntos.en.png


  11. The following instructions reset the points to zero, reduce the size of the penguin to make the game more difficult, and choose one of the available costumes for the penguin.

    _images/scratch3-p05-pinguino-iniciar.en.png


  12. Finally we are going to add movement to the penguin. Each time an arrow key is pressed, the penguin's position will change by one step.

    _images/scratch3-p05-pinguino-mover.en.png


  13. Press the green flag bandera-verde to test the operation of the program.

  14. As we can see, the penguin can chase the fish but still can't eat it. In order for the fish to be eaten, it will be necessary to add some more instructions.

    We select the penguin and in the code tab we add the following program.

    _images/scratch3-p05-pinguino-comer.en.png

    Now we select the fish and in the code tab we add the following program.

    _images/scratch3-p05-pez-reaparecer.en.png


  15. Press the green flag bandera-verde to test the operation of the program.


Challenges

  1. Add more fish costumes to the current fish. Every time the penguin eats the fish, a different fish will appear.

    To achieve this, use the command "next costume" in the appropriate place.


  2. Add a new character that subtracts points when eaten. For example, it can be a jellyfish or "jellyfish".

    The program will be similar to eating a fish, but this time it will subtract points instead of adding.

    The new character that subtracts points must appear when 10 seconds have passed from the start of the game.


  3. Add a new character, for example, a shark that eats the penguin when touched. In this case the penguin disappears and the game is over.

    The new character that subtracts points must appear when 20 seconds have passed from the start of the game.