Mountain Skiing

Type
Game
Category
Downhill dodging game
Author
Andre Persidsky
Published in
Antic, October 1983 (Vol. 2, No. 7), "Kids' Korner"
Year
1983
Language
Atari BASIC
Requirements
16K RAM, joystick in port 1, Atari BASIC
A GRAPHICS 0 instruction screen headed MOUNTAIN SKIING BY ANDRE PERSIDSKY in inverse letters, explaining the goals and joystick control, ending PRESS ANY KEY TO START

About the program

Antic revived its "Kids' Korner" in October 1983 with this game by Andre Persidsky, aged 12, of San Francisco, who was also learning PILOT and assembly language. It is a simple but fast-paced game. Your skier stays in the middle of the screen while the slope rushes up toward him, and you steer left and right to miss the trees, rocks and bushes. Every beep is a point, and every 20 points is a "goal": a line of markers crosses the slope, and the count starts again. As the points climb toward each goal, extra obstacles start to appear.

At 35 lines it is a perfect first type-in, and it uses one of the neatest tricks in GRAPHICS 0.

What you need

A joystick in port 1 and Atari BASIC.

Typing it in

Plain ASCII apart from inverse video in lines 1 and 10 ({inv}…{/inv}, Atari key) and {CLEAR} (ESC then SHIFT-CLEAR) in line 100. The long PRINT statements in lines 20–70 contain extra spaces to make the words break neatly at the screen edge, so copy the spacing if you want the instructions to look tidy. Line 140 is just ?. It is the most important statement in the program (see below).

How to play

Press any key after the instructions. Push left or right to steer. When you crash, the program shows your points and goals. Press the trigger to play again.

How it works

  • Scrolling for free. Line 140 prints an empty line. Because the cursor sits at the bottom of the GRAPHICS 0 screen, every ? makes the OS scroll the whole screen up one line. The obstacles move up past the skier without the program moving any of them.
  • POKEing characters. The skier and the obstacles are keyboard graphics characters POKEd straight into screen memory, found at PEEK(88)+256*PEEK(89). Screen codes 72 and 74 are the basic obstacles, and 80 and 84 are the extra ones. 83 draws the goal line and 87 is the skier, who sits 460 bytes in, on row 11. New obstacles go on row 22 (offset 880) at a random column.
  • Crash test. Line 220 PEEKs the cell just below the skier (A+40). Whatever is there will scroll into him on the next line, so anything other than a blank means a crash.
  • Lines 190–200 add the extra obstacles once the points (SD) pass 9 and 14. G counts the goals.

Variations to try

Change the 25 in line 180 to make points come faster or slower, or change the thresholds in lines 190–210 to make the slope crowded sooner.

Listing

1 REM MOUNTAIN SKIING by Andre Persidsky for {inv}ANTIC MAGAZINE{/inv}
10 PRINT CHR$(125):POKE 752,1:POSITION 12,12:PRINT "{inv}MOUNTAIN{/inv} {inv}SKIING{/inv}":POSITION 10,13:? "BY {inv}ANDRE{/inv} {inv}PERSIDSKY{/inv}":?
20 ? "THE OBJECT OF THIS GAME IS TO PASS THE TREES,ROCKS AND BUSHES WITHOUT       GETTING HIT.";
30 ? :? "EVERY TIME YOU HEAR A BEEP, YOU SCORE ONE POINT."
40 ? "IF YOU GET MORE THAN 19 POINTS YOU    WILL HAVE REACHED YOUR GOAL.  YOUR    SCORE WILL GO BACK TO ZERO ";
50 ? "BUT YOU    WILL HAVE ONE GOAL WHICH IS EQUAL TO 20 POINTS."
60 PRINT "IF YOU CRASH YOU WILL SEE HOW MANY    LEFT OVER POINTS YOU HAVE AND ALSO HOW MANY GOALS YOU REACHED."
70 ? "USE YOUR JOYSTICK TO CONTROL THE SKIER WHO IS IN THE MIDDLE OF THE SCREEN TO MOVE LEFT AND RIGHT."
80 ? :? "PRESS ANY KEY TO START.":POKE 764,255:POKE 77,0
90 IF PEEK(764)=255 THEN 90
100 ? "{CLEAR}":POKE 752,1
110 S=PEEK(88)+256*PEEK(89)
120 SETCOLOR 2,0,0
130 A=S+460
140 ST=STICK(0):?
150 POKE A,87
160 A=A-1*(ST=11)+1*(ST=7)
170 R=S+880+INT(40*RND(1)):POKE R,72:POKE R+1,74
180 SC=SC+1:IF SC>25 THEN SC=1:SD=SD+1:SOUND 0,5,10,15:FOR W=1 TO 3:NEXT W:SOUND 0,0,0,0
190 IF SD>9 THEN POKE R+10,80
200 IF SD>14 THEN POKE R+7,84
210 IF SD>19 THEN GOTO 300
220 IF PEEK(A+40)<>0 THEN 250
230 POKE A+40,0
240 GOTO 140
250 SOUND 0,255,8,15:FOR W=1 TO 300:NEXT W:SOUND 0,0,0,0
260 PRINT "YOU HAVE CRASHED,YOUR SCORE IS ";SD;".YOU REACHED GOAL ";G;:FOR W=1 TO 1000:NEXT W:? CHR$(125)
270 PRINT "PRESS TRIGGER TO PLAY AGAIN."
280 IF STRIG(0)=0 THEN CLR :GOTO 100
290 GOTO 280
300 G=G+1:FOR C=S+880 TO S+919:POKE C,83:NEXT C:? "GOAL ";G;" IS REACHED":FOR W=1 TO 1000:NEXT W
310 PRINT CHR$(125):PRINT "SO FAR YOU HAVE  REACHED GOAL ";G:? "GOODLUCK":FOR W=1 TO 1200:NEXT W
320 PRINT CHR$(125)
330 SD=0
340 GOTO 110

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: MTSKIING.BAS.

Credits