Presenting QuetzalcoAPL!
A new game for the Commodore SuperPET paying tribute to Larry Cohen’s cult classic film, “Q: The Winged Serpent,” written in APL for the Lost in Adaptation game jam.
“You know, the Empire State Building had King Kong and I thought the Chrysler building was a nicer building and it deserved its own monster, and so we gave them their own monster.” — Larry Cohen in the Q Director Commentary
Q was a creature feature by Larry Cohen about the Aztec winged serpent Quetzalcoatl taking up roost in the Chrysler Building. The Commodore SuperPET was released in 1981. Q came out in 1982, so it seemed like good match for the game platform. It’s easy to run the game using the Vice emulator if you don’t have a real SuperPET.
Begin by drawing the Chrysler Building in all its glory with the CHRYSLER function. Two machine gunners are positioned for action on the right of the building.
We can tighten up the screen using the SCRUNCH program to remove the tiny pixel spaces between the characters:
Before and after scrunching:
It looks a little bit like the Metropolis building now. If you prefer the taller look and gamefield, just skip using SCRUNCH.
Quetzalcoapl is stored as two arrays: screen memory locations and character data to poke into those locations. Define Quetzalcoapl using the function T:
Three other representations of Quetzalcoapl will appear as the game progresses.
The main game function G paints the Chrysler Building, initializes variables and then loops while accepting joystick input:
Line 13 is FinnAPL idiom 650 and used to smooth repainting of Q. Comment out line 16 if you want to increase the frequency of Q’s fireballs. HANDLEJOY moves the ground gun and fires the various guns with CSHOOT, then calls MOVEDRAC to move Q around the play field.
“Probably one of the last of the stop-motion photography monster pictures” -Larry Cohen
MOVEDRAC enforces the boundaries of screen memory to prevent Quetzalcoapl from wreaking havoc by flying off into system memory and overwriting program code.
Why is it called MOVEDRAC and not MOVEQ? This game extends the combat and movement engine I developed for Dracu-Lark, enhancing the code to use multi-position arrays for player characters.
All the shooting happens in CSHOOT, and collision detection happens here. Missiles launched by both the player and Q are handled in the same way. CSHOOT takes two arguments, the starting screen location and how many screen positions to move the missile each turn.
If Q strikes either machine gunner, the KILL branch is selected. The lives remaining counter is decremented and printed to screen, and the gunner falls to their death.
The player begins with 9 lives.
Rockets in flight look at the next character ahead of them to detect an impact. If they see a blank space, they continue flying.
When a player missile hits Q, usually it causes a unit of damage, but certain armor characters render the bullets harmless and these impacts cause no damage.
REDUCE is called if Q has taken enough hits to cause it to change form. The forms defined in U, V, and VDOWN are each used in turn.
If you are using the Vice emulator, be sure to set up the Joysticks for input.
Configuring the Vice emulator keyboard joysticks:
Have fun!
Download the APL code at https://solarbreeze.itch.io/queztcoapl