Skip to main content

Your first game

Practical case: Let's create our first game!

With all this we can create a simple game.

  • At the beginning of the game, just the cat appears in a Stage of your choice, asks your name, greets you and invites you to play.
  • Next the dog appears.
  • We will move the cat with the arrows of the keyboard. As the cat moves, it changes of costume simulating it walks.
  • When the cat touches the dog, the dog moves to a random place and barks.
Solution

In a previous activity we have seen that the "If...then" block can be added four times after pressing each key. This solution shows how to put these blocks just once in a separate program within Cat programming. It is necessary to add the "forever" block so that it is constantly checking if the cat touches the dog.



Cat program:


imagen.pngimagen.png

 
Dog code:

imagen.png