Page 235 - Learn to Program - Basic-256
P. 235

Chapter 15: Arrays – Collections of Information.                                Page 219


                   shape.


                   In Program 94 we will use the stamp from the mouse chapter to draw a big X
                   with a shadow. This is accomplished by stamping a gray shape shifted in the
                   direction of the desired shadow and then stamping the object that is
                   projecting the shadow.




                1       # shadowstamp.kbs
                2       # create a stamp from an array
                3
                4       xmark = {-1, -2, 0, -1, 1, -2, 2, -1, 1, 0, 2, 1, 1,
                        2, 0, 1, -1, 2, -2, 1, -1, 0, -2, -1}
                5
                6       clg
                7       color grey
                8       stamp 160,165,50,xmark[]
                9       color black
                10      stamp 150,150,50,xmark[]
            Program 94: Shadow Stamp

































                                                           © 2019 James M. Reneau (CC BY-NC-SA 3.0 US)
   230   231   232   233   234   235   236   237   238   239   240