Page 66 - TechPluse_C4_Flipbook
P. 66

Step 5     To move the sprite backwards, drag “move 10 steps” block and change
                              10 to -70. This will move the sprite to the left (in the opposite direction of

                              the face of sprite).
                  More Motion Blocks

                  Step 1     Drag the “turn 15 degrees” block to the previous block

                              of code and release it below the previous ‘move’ block.
                              It will attach itself to the ‘move’ block.
                  Step 2     Add more blocks. Double-click on the blocks to play

                              the animation and see your sprite move.
                  Events Blocks


                  They are colour-coded yellow and are used to sense events,
                  which run the scripts like when a sprite is pressed, a key is
                  pressed, or the green flag is clicked. They are placed at the
                  top of any script. They control starting of the scripts. The first

                  block present in control is the “when green flag clicked”
                             block.

                  Drag the “when green flag clicked” block out in the coding

                  area  on top  of the  blocks you  already  have  in your  script.
                  Now, instead of having to double click on your block of code,
                  you can just click on the Go button (green flag) to play your
                  animation.


                                          Control Blocks


                                          They  are  colour-coded  amber and  are  used to control  the
                                          scripts. This is a very important category because they are used
                                          to create loops, conditions, and sequences in code, and can
                                          make characters repeat actions until a condition is met.






                                            Tech



                                              Funda             To remove a block from a script, just drag


                                                                it to the left, away from the Scripts pane.






               64       Premium Edition-IV
   61   62   63   64   65   66   67   68   69   70   71