Page 146 - ScienceStd4
P. 146

Activity 15


               Creating a game to make a ‘Sprite’(Cat) move in four directions
          FOR ONLINE READING ONLY
               The  following steps  will guide you to  create a  game that
               makes a Sprite to move up, down, left, and right while making
               sounds.


               Steps


               1.  Click on the ‘Events’ block menu.


               2.  Drag and drop the ‘when key pressed’ block into the script
                    area. Then select ‘up arrow’.


               3.  Click on the ‘Motion’ block menu.

               4.  Drag and drop the ‘point in direction’ block into the script
                    area. Then attach this block to the ‘when key pressed’

                    block as shown in in Figure 45.





















                          Figure 45: The ‘point in direction’ block attached to the ‘when

                                         key pressed’ block.
               5.  Change the degrees in the ‘point in direction’ block from
                    90 to 0, as shown in Figure 46. This will make the Sprite

                    move up when the ‘up arrow’ key is pressed.


                                                   139




                                                                                            14/01/2025   18:38
     SCIENCE AND TECHNOLOGY STD 4.indd   139
     SCIENCE AND TECHNOLOGY STD 4.indd   139                                                14/01/2025   18:38
   141   142   143   144   145   146   147   148   149   150   151