Page 126 - 2403_Trackpad_V5.1_C5_Fb
P. 126

21 st
                         LAB ACTIVITY                                                       Century   #Technology Literacy
                                                                                              Skills
                        Visit your computer lab and perform the following actions:
                        ▶   Create a game of Pong using the knowledge of all the various blocks you have learnt
                          so far. The goal of the game is to keep the ball moving by hitting it with the paddle and
                          preventing it from touching the red line. Add a background and other customisations
                          according to your creativity.

                             Follow the instructions below to create the game. (You can also make changes
                          accordingly).
                            (a)  Create two sprites: a ball that the user will be playing with and a paddle to control
                              the ball.









                            (b)  Now, let’s create stacks of blocks to move the paddle sprite left and right so that it
                              can come in contact with the ball.











                            (c)  To control the behaviour and movement of the ball, create the following stacks of
                             code for the ball.

































                  124   Premium Edition-V
   121   122   123   124   125   126   127   128   129   130   131