Classic Computer Magazine Archive COMPUTE! ISSUE 46 / MARCH 1984 / PAGE 138

TI Aquarium

Michael A Covington

Turn your TI into an aquarium. And the best part is, you never have to change the' water. For TI-99/4A with Extended BASIC. The program also demonstrates some basic sprite techniques.

Recent studies have shown that the relaxing experience of watching fish glide around in an aquarium can lower your blood pressure and have other beneficial effects. This program (which we present somewhat with tongue in cheek) enables you to avoid the expense and bother of a real aquarium by using your TI-99/4A to simulate one.

Lines 310 to 330 establish the characteristics of a double-sized, fish-shaped sprite. Lines 400 to 430 read a number from the DATA statement (340) and, treating it both as a sprite number and as a color number, create a fish accordingly. When the sprite is created, it has the same color as the background (color 1, "transparent").

It is made visible by a separate COLOR statement because newly created sprites tend to appear momentarily in the wrong place before jumping to the specified location. If this phenomenon were visible, it would detract from the atmosphere of tranquility.

The subroutine at line 610, which is called several times while the fish are being created and repeatedly after they are on the screen, makes random changes in sprite motion so that the fish move in realistic bobbing movements rather than in straight lines at constant speed.

Relax and watch the fish glide by in "TI Aquarium."