Page 169 - Scratch Programming Playground
P. 169

X X Uses a variable to track when a cheat mode is turned on
                or off

            X X Lets the player control the direction of the snake with the
                keyboard but not the speed

            X X has no end goal; the player continues playing as long as
                possible

                The Snaaaaaake game’s keyboard controls are similar to
            those of the Maze Runner game in Chapter 3. The player has
            a top-down view and moves up, down, left, and right. however,
            the Snaaaaaake game is different because the player’s charac-
            ter is always moving. The player can control only the direction.
            You can use this style of movement in fast-paced games of your
            own design.
                In Chapter 7, you’ll learn how to use the mouse in your pro-
            grams by creating a clone of the Fruit Ninja game. Then your
            programs will be able to use a keyboard, a mouse, or both!




                Review Questions

                Try to answer the following practice questions to test what
                you’ve learned. You probably won’t know all the answers off
                the top of your head, but you can explore the Scratch editor to
                figure out the answers. (The answers are also online at http://
                www.nostarch.com/scratchplayground/.)

                1.  What is the difference between when key pressed blocks
                    and if key pressed? then blocks?
                2.  What does the go to x: pick random -220 to 220 y: pick
                    random -160 to 160 block do?
                3.  What is the difference between the glide block and the go
                    to block?
                4.  Why do you need to draw the snake head facing to the
                    right?
                5.  Why does the costume center of the Head sprite need to be
                    set at the center?





                                                                              Snaaaaaake!    143
   164   165   166   167   168   169   170   171   172   173   174