Page 164 - Learn To Program With Scratch
P. 164

try it out 6-1
                            Enhance this guessing game with some fun modifications . For example, you could
                            make the game play music when someone wins, trigger a buzz for a wrong answer,
                            run automatically (without having to press the green flag each time), or keep track
                            of the number of correct answers to display the player’s score .



                         Triangle Classification Game
                 Triangle   As Figure 6-19 illustrates, a triangle can be classified as scalene, isosceles, or
          Classification .sb2  equilateral based on the lengths of its sides. In this section, you’ll explore a
                         game that quizzes players on these concepts.






                               Scalene               Isosceles          Equilateral
                          No sides are congruent.  At least two sides are congruent.  All sides are congruent.
                         Figure 6-19: Classifying a triangle based on its sides


                             The game draws a triangle on the Stage and asks the player to classify
                         that triangle as one of the three types. The user interface for this game is
                         illustrated in Figure 6-20.





                                                                             Scalene sprite

                                                                             Isosceles sprite
                                                                             Equilateral sprite



                                                                           Painter sprite (invisible)




                                                                           Tutor sprite


                         Figure 6-20: User interface for the triangle classification game









           142   Chapter 6
                                           www.it-ebooks.info
   159   160   161   162   163   164   165   166   167   168   169