The Pre-Installed Global Append Library
(The "toys" Library)



( Simple Modular Programming Language & Environment )





The following tasks constitute the initial Global Append Library which comes pre-installed with SiMPLE. (When invoking any of these tasks, remember to include the appropriate "Append" directive(s) at the end of your program listing.

                 Example:      Append G: rocket
                               Append G: explode
                                --- (etc.) ---
Or merely use a single "Append G: toys" directive.)




Task:                    Description:

copter (x,y,color) @     Draws a helicopter [in the specified color] at location
                         (x,y).  color can range from 1 through 15 (paste-to-screen
                         mode) or -1 through -15 (animation mode). In paste-to-screen
                         mode, successive calls produce new helicopters without
                         erasing any previous ones. In animation mode, the previous
                         helicopter is erased before drawing the new one.

explode (x,y) @          Creates a brief explosion on the screen at location (x,y).
                         [Note: Returns with the keyboard cleared.]

findufo (x,y,inertia,reset) @    Locates the flying saucer and returns its
                                 location in (x,y). [You can then draw the
                         flying saucer there by calling the ufo task.]
                         Enter with:

                            inertia: how much movement you want the UFO to exhibit.
                                     A large value (e.g., 1000) makes the movement
                                     more stable; a small value (near zero) makes
                                     it move around more, and therefore it becomes
                                     more difficult to hit.

                              reset: a value of 1 repositions the UFO to a new loca-
                                     tion and assigns it a new speed. [Note: This
                                     parameter must be passed in a container.]

rocket (x,y,color) @    
rocket (x,y,color,flame) @     Draws a vertically oriented rocket in the speci-
                               fied color] at screen location (x,y). Enter with:

                            color: can range from 1 through 15 (paste-to-screen mode)
                                   or -1 through -15 (animation mode). In paste-to
                                   screen mode, successive calls draw new rockets
                                   without erasing any previous ones. In animation
                                   mode, the previous rocket is erased before drawing
                                   the new one. [Rockets drawn using color = 8 are
                                   drawn without fins.]

                            flame: specifies the size of the rocket's exhaust flame
                                   (0 = no flame, thru 5 = max flame). [If this para-
                                   meter is omitted, defaults to max flame.]

smiley (x,y,color) @     Draws a smiley face [in the specified color] at location (x,y). 

stars @                  Creates a static background field of stars if called once;
                         creates a background field of twinkling stars if called in
                         a loop.

ufo (x,y,color) @        Draws a flying saucer [in the specified color] at location
                         (x,y).  color can range from 1 through 15 (paste-to-screen
                         mode) or -1 through -15 (animation mode). In paste-to-screen
                         mode, successive calls produce new flying saucers without
                         erasing any previous ones. In animation mode, the previous
                         flying saucer is erased before drawing the new one.
                         [Note: If the new (x,y) location is identical to the pre-
                         viously specified (x,y) location, the flying saucer will
                         not be erased and redrawn (since it hasn't moved anywhere).]

whererocket (x,y,color)  Returns in (x,y) the location where the rocket (specified by
                         'color') was last drawn.
______________________________________________________________________________________

       [NOTE: The following tasks work only in the Pro-SiMPLE universe.]
______________________________________________________________________________________

note (id,duration) @     Plays a musical note through the computer's built-in
                         speaker. Enter with:

                            id: the note (1 - 25) to be played.
                                (id = 1 is middle C)
                                (id = 0 produces silence)

                            duration: the duration of the note (in milliseconds).

song (n,key) @           Plays one of ten very brief musical selections through the
                         computer's built-in speaker. Enter with:

                            n: the musical selection (1 - 10) to be played.

                            key: the key (0 - 12) in which the song is to be played.
                                 (Middle C is key=0.)


The SiMPLE CodeWorks, Inc.
www.simplecodeworks.com