SCREEN 9 DIM x AS INTEGER, y AS INTEGER, r AS INTEGER DO x = RND * 720 y = (RND * 100) + 200 r = (RND * 20) + 10 CIRCLE (x, y), r, , , , .8 PRINT "" LOOP
This fun little program exploits a quirk in PC graphics adapters to create a simple animation effect. Because PCs were originally text machines, they supported a simple scrolling text display. Then when graphics were added, they needed to retain that scrolling capability for downward compatibility. The result is a graphics display that can quickly scroll upward one character height at a time. This scrolling is very fast even on the original XT class machines. Try it and see for yourself!
After you've run the program, try making various changes. First try making the "bubbles" larger or smaller (hint: the "r" stands for "radius"). Then try changing the "bubbles" to other shapes. Use the "LINE" statement, for example, to draw snowflakes instead of bubbles (hint: replace the "CIRCLE" statement with three or four "LINE" statements).