Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 93 - 2609_Logiccode
P. 93

    repeat  10
                                                        This block repeats the action inside the block the number
                                                        of times you set.

                                     forever
                                                        This block repeats the action inside it forever, until the
                                                        Stop button is clicked.

                                     if       then
                                                        This block checks if a condition is true. If it is, it does the
                                                        action inside.

                                     if        then

                                                        This block checks a condition and carries out one action
                                     else
                                                        if it’s true or a different action if it’s false.

                               SENSING BLOCKS

                     Sensing blocks are used to get user input, check a sprite’s position or determine if one
                     sprite is touching another.

                     Some of the commonly used Sensing blocks with their descriptions are as follows:

                                                         This block checks if the sprite is touching another sprite,
                           touching  mouse-pointer  ?
                                                        the mouse pointer or the edge of the screen.

                                                         This block checks if the sprite is touching a specific colour
                                 touching color   ?
                                                        on the screen.

                                                         This displays a question on the screen and waits for the
                        ask   What’s your name? and wait
                                                        user to type an answer.

                           color    is touching  ?      This block checks if one specified color is touching another.

                     Create the given script using all the blocks you’ve learned about, then click the Green Flag
                     to run it.

                                                                                             Scratch Coding Adventures  91

| 88 89 90 91 92 93 94 95 96 97 98 |