Sno Cat |
Copyright/Publisher: COMPUTE!'s Gazette/COMPUTE! Publications, Inc., Programmed By:
Andy Keplinger, Release Year: 1984, Genre: Winter Sports, Number Of Players: 1 |
IMTRODUCTION
Nobody ever climbed Everest like this. See if you can drive your super fast turbo-driven tractor to the top in
this game for the VIC and 64.
INSTRUCTIONS
The Sno-Cat is a super-powered turbo-driven tractor that can go zero to fifty in less than a second. It has a minor problem,
however: It shifts its own gears. It starts in second, shifts into third automatically after ten seconds, then into fourth after fifty
seconds. It can't go any higher, but it doesn't need to. It's difficult to maintain control in third gear, let alone fourth.
Fortunately you have brakes, very powerful brakes that will slow you down to almost zero in tricky situations. To stop
overuse, the brakes (controlled by the fire button or space bar) cause the distance meter to stop as long as the brakes are
pressed. But the timer still runs, so your time may be impaired by using the brakes too much.
Interrupt-Controlled
If you look at the main routine, you may notice there are no statements for controlling the player or the trees. These are
controlled by an interrupt routine in machine language, those first few lines of data (lines 10-64). The routine automatically
moves sprites 1 through 7 down the screen and moves sprite 0 (the Sno-Cat) according to the joystick's position.
An interrupt routine is a special program that is run every 1/60 second. The computer's normal interrupt routine is used to
read the keyboard and update the values in the timer. It's called an interrupt routine because it stops whatever the computer
is doing, checks for a keypress adds to the timer, and lets the computer continue.
I've changed this a little. The new order is to go to the sprite movement routine, then continue with the normal interrupt
routine functions. So now, every 1/60 second, it will move every sprite down a little and move the Sno-Cat.
Two Things At Once
If you press RUN/STOP during the game you can move the joystick around and see that the modified interrupt routine is
still functioning. Pressing RUN/STOP and RESTORE together returns things to normal.
The first reason for an interrupt is speed. With an interrupt routine, the computer can process a BASIC program and
still execute the sprite movement routine at the same time — in effect, doing two things at once.
The second reason is for smoothness in movement. This routine is performed every 1/60 second while the BASIC
portion of the program is completing a loop about ten times a second. Without an interrupt routine, the sprites would blink
and jump around the screen.
The machine language data is broken into two parts, but only the first part is called from BASIC. It simply tells the
computer to add the sprite routine to the normal interrupt sequence.
Sprite Movement
The second part is the sprite movement routine itself. It starts at memory location 841 and is broken into two more parts.
The first is the machine language equivalent of this BASIC program:
10 MEMSTART = 53251 : REM VERTICAL :POSITION OF SPRITE 1
20 FOR X=1 TO 7 : REM COUNT FROM 1 TO 7
30 A=PEEK(MEMSTART) : REM GET SPRITE X'S VERTICAL POSITION
40 A=A+2 : IF A<256 THEN 60
50 A=251 : REM A IS 251 IF A WAS > 255 IN LI NE 40
60 POKE MEMSTART,A : REM PUT A IN SPRITE X'S VERTICAL POS.
70 MEMSTART=MEMSTART+2 : REM GET NEXT SPRITE POS.
80 NEXT X : END : REM BACK AROUND UNTIL SPRITE 7 IS REACHED
The second part moves a sprite right or left according to the joystick input. If you don't have a joystick, use the CTRL key
for left and the 2 key for right. The space bar can be used to apply the brakes. Them is no special provision for this in the
program; it is built into the computer's keyboard reading routine.
The BASIC part of the program is broken into five parts: the main routine in lines 150-180, the opening screen in lines
400-880, the instruction screen in lines 1000-1180, the YOU MADE IT screen in lines 1500-1700, and the
YOU CRASHED routine in lines 3000-3240. All of these, except the instruction screen, call the tree scroll routine.
|
|