Snowbird

Type
Game
Category
Action game (bird catches rats on a frozen lake)
Author
John Weber
Published in
Antic, January 1984 (Vol. 2, No. 10), In the Public Domain
Year
1984
Language
Atari BASIC
Requirements
16K RAM, Atari BASIC, joystick in port 1
A grey frozen lake in big blocky characters with a brown telephone pole on the left, a white bird on its crossbar, a black rat on the ice, blue water holes and open water at the bottom

About the program

In Snowbird, a pack of water rats is breaking up a frozen lake. Each rat that reaches the surface scurries to the nearest hole, dives in and gnaws its way up again, and every trip leaves another hole. Unless they're stopped, the article warned, "the lake will resemble swiss cheese". You are the Snowbird, perched on a telephone pole, and your job is pest control. John Weber, who had written Track Star for the October 1983 issue, wrote it for Antic's January 1984 "In the Public Domain" section. (The magazine headed the article "Snowbirds".)

Typing it in

There are no special characters in this listing. The shapes for the bird, rats, holes and pole are all in the DATA lines, so check those numbers carefully. The REM in line 30 says "January, 1983", but the game appeared in January 1984. The program uses MOVX as a variable name, which Atari BASIC accepts but some replacement BASICs don't.

How to play

Type a starting level from 1 to 6 and press RETURN. Then:

  • Hold the button to fly up. Let go and the bird dives.
  • Push the joystick left or right to fly across.
  • Land on a rat to catch it: 100 points, or about 1,000 for a white rat.
  • Don't touch the water. That costs you the bird and the game starts again.

Holes are obstacles too. If one lies between you and a rat, you just flap in place until you go round it. Catch 20 rats (15 on the higher levels) and an ice sweeper drives across, filling every hole, and the game gets faster. If the rats make more than 50 holes, the lake breaks up and you start over.

How it works

  • The playfield is GRAPHICS 17 (big GRAPHICS 1 text, no text window). The game POKEs character codes straight into screen memory and PEEKs to see what's above, below or beside the bird. Codes with the top bits set show the same shape in a different colour, which is how white and black rats differ (lines 615 and 640).
  • Lines 2000–2015 lower RAMTOP by eight pages, copy the ROM font into RAM and redefine characters 57–63: the sweeper, bird, rat, fence, the crossbars of the pole, water and hole.
  • The telephone pole is player 0: a shaped top followed by a long run of 255 bytes, positioned with POKE 53248,72. POKE 623,1 gives players priority, so the pole is drawn in front of the ice.
  • Sound effects are POKEd straight into POKEY's first voice (53760–53761) inside short loops, which gives quick swoops and chirps.
  • The rats move only when RND(0)*10 is greater than HARD (10 minus the level), and each sweep lowers HARD, so the rats get busier.

Changes from the published listing

One change, so the program also runs under Altirra BASIC, the free replacement BASIC built into many emulators. Altirra BASIC adds a command called MOVE, so it rejected the published lines that use that word as the start of a variable name. The variable is renamed everywhere in the program. The new name is the same length, so the memory layout is unchanged and the program behaves exactly as published on genuine Atari BASIC. If you type it in from the magazine, the original names work fine on a real Atari.

Published Now Lines
MOVE MOVX 2010, 2015

Listing

10 REM ***** SNOWBIRD *****
20 REM *  BY JOHN WEBER   *
30 REM *  JANUARY, 1983   *
40 REM *  ANTIC MAGAZINE  *
50 REM ********************
100 GOSUB 1000:GOTO 500
400 REM FLY BIRD
410 POKE 77,0:LOOK=PEEK(BIRD-20)
415 IF LOOK=63 THEN 450
420 IF LOOK<>0 OR BIRD-20<SC THEN RETURN
430 POKE BIRD,0:POKE BIRD-20,58+64:BIRD=BIRD-20
440 IF STRIG(0)=0 THEN 400
449 RETURN
450 POKE BIRD,0:POKE BIRD-20,58+64:POKE BIRD-40,58+64:POKE BIRD-20,63:BIRD=BIRD-40
459 RETURN
500 ST=STICK(0):POKE BIRD,58+64
510 IF PEEK(BIRD+20)=0 THEN POKE BIRD,0:BIRD=BIRD+20:POKE BIRD,58+64:POKE 53760,50:POKE 53761,8
515 POKE 53760,0:POKE 53761,0
520 IF STRIG(0)=0 THEN GOSUB 400
535 NBIRD=BIRD+(ST=7)-(ST=11)
540 IF NBIRD<SC OR NBIRD>SC+479 THEN 500
550 IF PEEK(NBIRD)=0 THEN POKE BIRD,0:BIRD=NBIRD
551 LOOK=PEEK(BIRD+20)
552 IF LOOK=62 THEN GOTO 850
555 IF LOOK=63 THEN POKE BIRD,0
560 IF LOOK<>187 THEN 580
565 POKE 53761,168:FOR A=250 TO 202 STEP -4:POKE 53760,A:NEXT A
570 POKE BIRD,0:BIRD=BIRD+20:RA=0:SCORE=SCORE+100:HIT=HIT+1:GOTO 590
580 IF LOOK<>123 THEN 590
582 POKE 53761,170:FOR A=150 TO 250 STEP 4:POKE 53760,A:NEXT A
585 POKE BIRD,0:BIRD=BIRD+20:RA=0:SCORE=SCORE+1100:HIT=HIT+1
590 IF RND(0)*10>HARD THEN GOSUB 600
595 IF HARD<6 THEN IF HIT=15 THEN POKE MOUSE,0:GOSUB 800
597 IF HIT=20 THEN POKE MOUSE,0:GOSUB 800
598 POSITION 9,0:? #6;SCORE
599 POKE 53760,0:POKE 53761,0:GOTO 500
600 REM MOVE RATS
605 IF RA=1 THEN 620
610 RAT=SC+INT(RND(0)*439)+20:IF PEEK(RAT)<>0 THEN 610
612 IF RAT<SC+141 OR RAT>SC+378 THEN 610
615 RA=1:POKE RAT,59+128:POKE RAT+1,63:HOLE=HOLE+1
618 IF HOLE>50 THEN POP :GOTO 4000
620 IF RAT-1<SC+121 THEN POKE RAT,0:RA=0:GOTO 610
625 SEE=PEEK(RAT-1):IF SEE=0 THEN POKE RAT,0:RAT=RAT-1:POKE RAT,59+128
630 IF SEE=63 THEN POKE RAT,0:RA=0:GOSUB 650:RETURN
640 IF RND(0)*10>9.5 THEN POKE RAT,59+64
649 RETURN
650 POKE 53761,136:FOR A=26 TO 116 STEP 10:POKE 53760,A:NEXT A:POKE 53760,0:POKE 53761,0:RETURN
800 REM MOVE TRACTOR AND FILL HOLES
810 FOR I=SC+120 TO SC+379
815 SOUND 0,100,18,8:SOUND 1,150,8,8
820 POKE I,57+128:FOR A=1 TO 25:NEXT A:POKE I,0:? #6;"      ":REM 6 SPACES
825 POSITION 9,0:? #6;SCORE:POSITION 9,0:NEXT I:HOLE=0
830 HARD=HARD-1:IF HARD<4 THEN HARD=4
849 SOUND 0,0,0,0:SOUND 1,0,0,0:HIT=0:RETURN
850 REM LOSE BIRD AND START OVER
855 POKE BIRD,0:FOR A=75 TO 180 STEP 5:SOUND 0,A,10,8:FOR W=1 TO 20:NEXT W:NEXT A:SOUND 0,0,0,0
860 POKE 53248,0:GOSUB 2050:GOTO 500
1000 REM ENTER LEVEL
1005 GRAPHICS 0:POKE 710,68:POKE 712,68:POKE 752,1:POSITION 15,5:? "SNOW BIRD"
1010 POSITION 3,10:? "WHICH LEVEL DO YOU WANT TO START?"
1015 TRAP 1015:POKE 752,0:POSITION 13,15:? "ENTER 1 - 6 ";:INPUT LEVEL
1025 IF LEVEL<1 OR LEVEL>6 THEN 1010
1030 HARD=10-LEVEL
1050 GRAPHICS 0:POKE 752,1:POSITION 13,5:? "PLEASE WAIT..."
2000 RAMTOP=PEEK(106)-8:POKE 106,RAMTOP:CHBAS=RAMTOP:START=CHBAS*256
2005 FOR I=0 TO 1023:POKE START+I,PEEK(57344+I):NEXT I
2010 FOR I=57 TO 63:MOVX=START+(I*8)
2015 FOR A=0 TO 7:READ SHAPE:POKE (MOVX+A),SHAPE:NEXT A:NEXT I
2050 GRAPHICS 1+16:POKE 756,CHBAS:POKE 712,8:POKE 710,0:POKE 709,255:POKE 711,34:POKE 708,132
2055 SC=PEEK(88)+256*PEEK(89):BIRD=SC+45
2060 SCORE=0:HOLE=0:HIT=0
2085 GOTO 3000
2089 DATA 0,0,24,24,24,126,36,126
2090 DATA 0,195,36,24,24,36,0,0
2091 DATA 144,112,113,190,0,0,0,0
2092 DATA 100,255,100,255,100,255,100,255
2093 DATA 255,255,255,255,0,0,0,0
2094 DATA 192,240,252,255,76,24,1,75
2095 DATA 13,8,42,168,42,170,170,168,40
2099 DATA 126,126,255,127,127,254,254,255,255,126,126,254,255,254,126,126,255,255,255,255,126,127,127,126
3000 FOR I=SC+460 TO SC+479:POKE I,60+192:NEXT I
3005 FOR I=SC+61 TO SC+65:POKE I,61+192:NEXT I:FOR I=SC+101 TO SC+105:POKE I,61+192:NEXT I
3015 FOR I=SC+400 TO SC+459:POKE I,62:NEXT I
3020 FOR I=SC TO SC+7:POKE I,60+192:NEXT I:FOR I=SC+13 TO SC+19:POKE I,60+192:NEXT I
3022 FOR I=SC+380 TO SC+386:POKE I,60+192:NEXT I:FOR I=SC+394 TO SC+399:POKE I,60+192:NEXT I
3050 REM P/M GRAPHICS
3055 PM=PEEK(106)-16:POKE 54279,PM:PMBASE=PM*256:POKE 53277,3:POKE 704,244
3060 FOR I=PMBASE+1024 TO PMBASE+1279:POKE I,0:NEXT I:RESTORE 2099
3065 FOR I=PMBASE+1024+50 TO PMBASE+1047+50:READ PMG:POKE I,PMG:NEXT I:FOR I=PMBASE+1048+50 TO PMBASE+1250
3070 POKE I,255:NEXT I
3095 POKE 53248,72:POKE 623,1:POKE 559,62
3099 RETURN
4000 REM DRAW WATER
4007 FOR I=SC+385 TO SC+25 STEP -20
4008 SOUND 0,13,8,15
4010 FOR A=-INT(RND(1)*4) TO INT(RND(1)*18):POKE I+A,62:NEXT A
4015 FOR A=1 TO 20:NEXT A:SOUND 0,0,0,0:NEXT I:POKE 712,134:FOR A=1 TO 500:NEXT A
4025 POKE 712,148:FOR A=1 TO 500:NEXT A:POKE 53248,0:POKE 710,134:POKE 711,134:POKE 709,134:POKE 708,134
4030 POKE 712,134:FOR A=1 TO 500:NEXT A
4060 GOSUB 2050:GOTO 500

Download

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

Credits