Tag
- Type
- Game
- Category
- Two-player chase game
- Author
- Greg Burdett
- Published in
- Antic, November 1983 (Vol. 2, No. 8), Kids Korner
- Year
- 1983
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit, Atari BASIC, two joysticks (ports 1 and 2)
- Tags
- antic, kids-korner, two-player, joystick, graphics-5, beginner, short-program, greg-burdett, 1983
- Related
- Mountain Skiing, 3-D Maze Escape, Alpha Run, Bats, Bounce, Box-In
About the program
Tag appeared in Antic's Kids Korner in November 1983. Its author, Greg Burdett of Ogden, Utah, was 14. He had started programming his Atari 800 after a computer camp at Brigham Young University two years earlier, and he already knew some assembly language and player/missile graphics. The article calls Tag "a simple reaction game for two players".
Each player steers a coloured dot with a joystick: player 1 starts on the left, player 2 on the right. Player 1 is "It" first and has to catch the head of the line that player 2's dot is drawing. When the catch is made, the time is shown, the computer plays a tune, and the roles swap. Whoever makes the catch in less time wins. The trails soon cover the screen in a criss-cross pattern, so the program clears it every sixty seconds.
Typing it in
There are only a couple of special characters. {UP} in lines 280–310 is the cursor-up character, typed inside the quotes as ESC then CTRL-−. The instruction screens in lines 400–430 mix inverse ({inv}…{/inv}: press the Atari key before and after) and lower-case words, which print in different colours in GRAPHICS 2. Line 10000 is never reached.
How to play
Plug in two joysticks and RUN. After the instruction screens, both dots appear on a black GRAPHICS 5 screen. The stopwatch in the text window counts minutes and seconds. Dots wrap from one edge of the screen to the other, and each player's moves have their own beep. The chase ends when the two dots land on the same square.
How it works
The program is a straightforward beginner's design, which makes it easy to follow and change:
- Lines 110–150 and 200–240 test every joystick direction with its own
IF, add −1, 0 or +1 to X and Y, and beep. - Lines 155–170 and 245–260 wrap the coordinates round the 80 × 40 screen.
- The catch test (lines 180–190 and 270): line 180 plots player 1's dot in colour 1 and then player 2's dot in colour 2.
LOCATEthen reads player 1's square. It can only return 2 if both dots are on the same square, which counts as a catch. The test is the same whoever is "It". The variablesAandBkeep track of whose turn it was. - The clock uses system countdown timer 1 at location 540. Line 95 reloads it with 60 (one second of frames) each time it reaches zero and advances the seconds. Every 60 seconds the screen is cleared by printing
CHR$(125)to the graphics channel. - The victory tune (lines 600–635) also uses location 540 to time its notes, playing a chord on all four voices.
Variations to try
- Make the dots faster by removing the
FOR I=1 TO 10:NEXT Idelays from the sound statements. - Change
GRAPHICS 5toGRAPHICS 3for bigger, chunkier dots. The screen is then 40 × 20, so change the wrap limits in lines 155–170 and 245–260 and the startingX2=79in line 30 to match.
Listing
5 GOSUB 400
10 A=0:B=0
20 GRAPHICS 5:POKE 710,0:POKE 752,1:M=0:S=0:POKE 77,0
30 X1=0:X2=79:Y1=20:Y2=20:GOTO 100
95 POKE 540,60:S=S+1:IF S=60 THEN M=M+1:? #6;CHR$(125):S=0
100 ST=STICK(0):ST1=STICK(1)
110 IF ST=15 THEN X1=X1+0:Y1=Y1+0
115 IF ST=14 THEN X1=X1+0:Y1=Y1-1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
120 IF ST=11 THEN X1=X1-1:Y1=Y1+0:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
125 IF ST=13 THEN X1=X1+0:Y1=Y1+1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
130 IF ST=7 THEN X1=X1+1:Y1=Y1+0:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
135 IF ST=6 THEN X1=X1+1:Y1=Y1-1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
140 IF ST=10 THEN X1=X1-1:Y1=Y1-1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
145 IF ST=9 THEN X1=X1-1:Y1=Y1+1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
150 IF ST=5 THEN X1=X1+1:Y1=Y1+1:SOUND 0,120,10,8:FOR I=1 TO 10:NEXT I:SOUND 0,0,0,0
155 IF X1>79 THEN X1=0
160 IF X1<0 THEN X1=79
165 IF Y1>39 THEN Y1=0
170 IF Y1<0 THEN Y1=39
180 COLOR 1:PLOT X1,Y1:COLOR 2:PLOT X2,Y2
190 LOCATE X1,Y1,X
200 IF ST1=15 THEN X2=X2+0:Y2=Y2+0
205 IF ST1=14 THEN X2=X2+0:Y2=Y2-1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
210 IF ST1=11 THEN X2=X2-1:Y2=Y2+0:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
215 IF ST1=13 THEN X2=X2+0:Y2=Y2+1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
220 IF ST1=7 THEN X2=X2+1:Y2=Y2+0:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
225 IF ST1=6 THEN X2=X2+1:Y2=Y2-1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
230 IF ST1=10 THEN X2=X2-1:Y2=Y2-1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
235 IF ST1=9 THEN X2=X2-1:Y2=Y2+1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
240 IF ST1=5 THEN X2=X2+1:Y2=Y2+1:SOUND 1,150,10,8:FOR I=1 TO 10:NEXT I:SOUND 1,0,0,0
245 IF X2>79 THEN X2=0
250 IF X2<0 THEN X2=79
255 IF Y2>39 THEN Y2=0
260 IF Y2<0 THEN Y2=39
265 COLOR 2:PLOT X2,Y2
270 IF X=2 OR X=4 THEN A=A+2:B=A/2:GOSUB 300
275 IF PEEK(540)=0 THEN 95
280 ? "{UP}";M;":";S;" "
285 GOTO 100
300 IF B=1 THEN ? "{UP}PLAYER #2 IS NOW IT!!!!":? "PLAYER #1 DID IT IN ";M;":";S;" BEAT THAT #2!":GOSUB 600
310 IF B=2 THEN ? "{UP}PLAYER #1 IS NOW IT!!!!":? "PLAYER #2 DID IT IN ";M;":";S;" BEAT THAT #1!":A=0:B=0:GOSUB 600
320 GOTO 20
400 GRAPHICS 2:POKE 710,0:? #6:? #6;" {inv}player {/inv}#1{inv} is the dot on the left side of the screen{/inv}"
410 ? #6:? #6;" player #2 is the dot on the right side of the screen"
420 FOR I=1 TO 1000:NEXT I
430 GRAPHICS 2:POKE 710,0:? #6:? #6:? #6:? #6;" player #1 is 'it' first":FOR I=1 TO 500:NEXT I:RETURN
600 RESTORE 620
610 READ TONE,TYPE:IF TYPE=0 THEN RETURN
612 POKE 540,TYPE:SOUND 0,TONE,10,8:SOUND 1,TONE+2,10,8:SOUND 2,TONE-2,10,8:SOUND 3,TONE,10,8
615 IF PEEK(540)=0 THEN SOUND 0,0,0,0:SOUND 1,0,0,0:SOUND 2,0,0,0:SOUND 3,0,0,0:GOTO 610
618 GOTO 615
620 DATA 162,8,162,24,162,8,162,24,182,8,196,24,162,8,121,24,108,8,96,24,96,8,96,24,108,8,121,32,121,24,128,8
625 DATA 144,24,144,8,144,24,128,8,121,24,128,8,121,24,144,8,162,24,144,8,162,24,196,8,162,32,162,8,162,8
630 DATA 162,8,162,24,162,8,162,24,182,8,192,24,162,8,121,24,108,8,96,24,96,8,96,24,108,8,121,32,121,32,108,32
635 DATA 108,32,121,32,128,32,121,128,0,0
10000 GOTO 10000
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: TAG.BAS.
Credits
- Program listing: Tag — program listing (Antic, November 1983 (Vol. 2, No. 8), Kids Korner) — Greg Burdett
- Antic, November 1983 (Vol. 2 No. 8): Kids Korner - Tag, by Greg Burdett (atarimagazines.com) — Greg Burdett, 1983
- Antic disk, November 1983 - Vol. 2 No. 8: TAG.BAS (detokenized listing) — AtariMagazines.com (Kevin Savetz), 1983
