The Pre-Imported "@toys" Library

( Simple Modular Programming Language & Environment )
The following tasks constitute the initial Import Library which comes pre-installed with SiMPLE. (All of them require the handle: @toys.)
Task: Description:
explode (x,y) @toys Creates a brief explosion on the screen at location (x,y).
[Note: Returns with the keyboard cleared.]
findufo (x,y,inertia,reset) @toys 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) @toys
rocket (x,y,color,flame) @toys 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.]
stars @toys 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) @toys 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).]
______________________________________________________________________________________
[NOTE: The following tasks work only in the Pro-SiMPLE universe.]
______________________________________________________________________________________
note (id,duration) @toys 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) @toys 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