Session 2: Racket breaks

Work plan

  • Movement of the ball and racket. Relationship between both
  • Use of the sensors of the characters
  • Bounce ball
  • Bounce direction
  • Choose the bounce direction randomly
  • Sounds based on the action

Does racket and ball movement have a relationship?

Now that we have characters (racket and ball) and we know how to move the racket, we need to bounce the ball when the racquet touches it. That is, we have to detect when the two characters are played.

Icon tasksLet’s do it step by step

    • We entered our Scratch account and created a new project with the name m2 challenge21 .
    • We analyze the different sensors (already introduced in module 1):
      Block sensors
      Block sensors
    • If we need help, we recall that we have the help block on the right side:

Help sensors

  • We can say that the sensors are the senses of the characters, which allow us the interaction between them. From the first part of the sensor block, what options do we think may help us interact between the racket and the pong ball?
  • If for example the ball is green, the green color could be used as a sensor; Or bounce off when you touch the paddle. These are just two options. Can we find others?
    Bounce ball

Icon challenge Challenge 1

We continue working on our project m2 challenge21 . What we have to achieve now is that the ball bounces randomly so that the movement is not predictable.

Icon trackTrack: We can use the “randomly” (green) block to make the ball bounce in different directions. This option is already working in session 7 of module 1. We recommend using values close to 180 degrees. What happens if we use other values?


The machine plays alone

Another possibility of the pong is to play against the machine, that is, to make the racket move all alone. To try it, we will create a new new project called m2repte22

Icon tasksLet’s do it step by step

  • We entered our Scratch account and created a new project with the name m2 challenge21
  • We must get the racket moving in the same horizontal direction as the ball so that it always bounces over it
    Automatic game

Icon challenge Challenge 2

Let’s do it more realistically. We continue with the project  m2 challenge22 that you have open and to make the game more attractive we introduce sounds. Can we make the sounds different when the ball bounces on the wall or when the racket touches it?

Icon track Track: In the module 1 to session 8 the sounds of different characters worked


Icon project Our project grows …

It is time to review the description we have made in our pinball project  to define what movements our characters are doing and how they relate to each other.

We add to our description a new element: what sounds will be when people interact (racket / ball; ball / obstacles; …)? What sound will it be when the ball is lost? We have to make a diagram or table that reflects the possibilities of interaction and related sounds.

Let us not forget that we are defining it slowly and that, when introducing improvements, it is very possible that what we had initially thought changed. This is how programmers work, thinking first the idea to the last detail and then executing it.


Glossary icon Because we are programmers and programmers we talk about …

  • Random: random selection of an object (a number generally) according to automatically.
  • Sensors:  blocks that detect when there is some type of interaction between the characters or when the user interacts with the program.

Deixa un comentari

L'adreça electrònica no es publicarà. Els camps necessaris estan marcats amb *

XHTML: Trieu una d'aquestes etiquetes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>