Page 94 - Trackpad_V1_Book 5_Flipbook
P. 94

ADDING ONE MORE SPRITE


                  We need one more sprite in the shape of an arrow that will point to the
                  wheel to show which section has been chosen. To add one more sprite,
                  Click on Add a Sprite button and select Arrow1 sprite from the library.                   Arrow1
                  Now click on the OK button.




                            CODE THE WHEEL SPRITE

                  Now, after adding the sprites and the wheel, we will add the following code for the wheel.
                  To add the code, follow the given steps:

                  Step  1       Click on the Wheel sprite and make it active.

                  Step  2       Click on the Scripts tab and create the adjoining block stack.


                                                  when    clicked
                                                  go to x: –50  y: 10
                                                  set size to  90  %
                                                  forever

                                                   if   key space    pressed?   then

                                                      repeat   pick random 10  to  200

                                                       turn   20  degrees








                  ADDING BROADCAST BLOCK

                  To send messages between the sprites, use the broadcast block from the Events section.
                  To add the broadcast block, follow the given steps:



                                           1  Drag a broadcast message1
                                          block into the code area.


                                         broadcast message1


                                                                           2  Select the New
                                            New message
                                                                           Message option from
                                                                           the drop-down list.
                                            message1





                   92   Trackpad (Version 1.0)-V
   89   90   91   92   93   94   95   96   97   98   99