ARTICLE BY CHARLES JACKSON
Landscape Illusion
Scrolling scenery fools the eye
Take your Atari on a scrolling 3-D drive through
the desert, complete with engine noises. The illusion of three-dimensional
depth is surprisingly effective. This BASIC program works on all 8-bit
Atari computers with at least 32K disk or 24K cassette.
This colorful optical illusion demonstrates parallax-the way objects appear to move when the viewer changes position. 3-D Landscape Illusion simulates driving through a desert where nearby objects seem to "move" faster than more distant objects. There are also engine sounds to help maintain the illusion.
Type in Listing 1, GOWEST.BAS, check it with TYPO II and SAVE a copy before you RUN it. If you have trouble typing the special characters in lines 210, 1010,1030, 1100-1150, 1270-1280 and 1330-1350, don't bother typing them in. Listing 2 will create them for you and write them to a file called GWLINES.LST. Once you've created this file, type NEW and LOAD Listing 1. Next, ENTER the file created by Listing 2 to complete the program. Remember to SAVE a copy of the merged program before you RUN it.
Landscape Illusion simulates motion by scrolling the foreground and
back ground scenes at different rates.
When you RUN 3-D Landscape Illusion, it creates a desert scene divided into three independently scrolling horizontal strips. The mountains are drawn in the top strip, which moves slowest. The hills occupy the center strip, which scrolls a little faster than the mountains. The road is the bottom strip and scrolls fastest of all.
The Sun and the car bumper are players and remain stationary. The Player/Missile priority selection register (GPRIOR, memory location 623) is set to 2, allowing the Sun to apparently "slip behind" the taller mountain peaks. This instruction is in line 170.
ANTIC MODE 4
The hills, mountains and the road are made of redefined characters,
and displayed in ANTIC Mode 4 (Graphics 12 on XL and XE computers). This
four-color character mode has the same horizontal resolution and twice
the vertical resolution of Graphics 7-but requires less than a third as
much memory.
Unlike other character modes, ANTIC Mode 4 characters were not meant to be formed into words and sentences. They're primarily used to generate detailed play-fields which use a minimum of memory. To design original games or other graphics with your own ANTIC 4 characters, you need a special character set editor such as INSTEDIT ($15.95, The Catalog, AP0117).
Sub, a joystick-controlled illusion, simultaneously scrolls four horizontal
scenery "strips."
DISPLAY LIST BENDER
A Display List is a program which tells the ANTIC chip how to draw
the screen. Display lists may only have three types of instructions:
1. Where to get the information to display
2. How the information should be displayed (Graphics 0 characters, Graphics 8 bit-mapped graphics, ANTIC Mode 4 characters, etc.)
3. Are there any special options (such as vertical or horizontal scrolling, or interrupts) to consider?
3-D Landscape Illusion constructs a special display list which extensively uses all three types of instructions. The Graphics 23 call in line 40 establishes a Graphics 7 display list, without a text window.
Routines in lines 120-140 change this display list into the special ANTIC 4 display list which handles all three scrolling strips, plus the background.
A display list interrupt (DLI) at the start of each strip controls its horizontal scrolling, and changes color values at the bottom of the screen. A Vertical Blank Interrupt (VBI) routine controls the DLI's timing, and handles coarse scrolling. These routines are called in lines 210 and 220.
DISK BONUS
This month, Antic Disk owners are treated to a second optical illusion.
SUB.EXE is a machine language joystick-controlled scrolling demo for all
8-bit Atari computers. This smoothly detailed, unearthly landscape was
programmed by Patrick Bass, Antic's ST Program Editor. To see SUB in action,
choose Main Menu selection 1 to get into DOS and then [L]oad SUB.EXE from
DOS Menu selection L.
The following books will teach you more about these advanced graphics techniques:
Atari Graphics and Arcade Game Design
By Jeffrey Stanton with Dan Pinal
477 pages
$19.95, Antic Catalog, MG0103
Your Atari Computer
By Lon Poole
Osborne/McGraw-Hill
465 pages
$17.95
Pennsylvanian Joe Brzuszek sent us this impressive graphics demo along with a letter explaining why he believes the 1/60th-second television screen refresh rate is not fast enough to meet the Antic Lightstick Challenge (July 1986, page 29).
Listing 1: GOWEST.BAS Download
Listing 2: LINES.BAS(not needed)
On Disk: SUB.EXE Download