Creative Programming With Player/Missile Graphics, P/M tutorial (GR0PM.BAS)
Creative Programming With Player/Missile Graphics, P/M tutorial by Philip Seyer, 50
Description
Creative Programming With Player/Missile Graphics, P/M tutorial by Philip Seyer, 50
From the Antic disk of April 1984 (Vol. 3 No. 1).
From the Antic Software Archive at atarimagazines.com. The program remains the property of its author and publisher.
What is in this file
Atari BASIC program · 5.1 KB
- Dialect
- Atari BASIC
- Lines
- 129
- Variables
DELAY,I,X
BASIC listing (129 lines)
1 REM GRAPHICS 0 P/M
2 REM BY PHILIP C. SEYER
3 REM ANTIC MAGAZINE APRIL 1984
4 ? CHR$(125):REM CLEAR SCREEN
5 POKE 752,1:REM TURN OFF CURSOR
7 GOSUB 500:REM SIMPLIFIED PMG SETUP
10 POSITION 2,10:? "In this example,"
20 ? "we are NOT using"
25 ? "the ANTIC chip or"
30 ? "Direct Memory Access"
32 ? "to fetch Players "
33 ? "or Missiles."
35 GOSUB 900:REM Wait for user to press a key.
36 ? CHR$(125):REM CLEAR SCREEN
40 POSITION 24,9:? "Notice how easy"
42 POSITION 24,10:? "it is to add "
44 POSITION 24,11:? "Color to "
46 POSITION 24,12:? "Graphics Mode 0."
50 DELAY=300:GOSUB 700:REM PAUSE FOR A MOMENT
60 POSITION 24,16:? "Like this!":DELAY=50:GOSUB 700
62 POKE 53248,176:POKE 53249,144:REM PUT PLAYERS ON SCREEN
65 DELAY=100:GOSUB 700
70 POSITION 24,18:? "It's also easy"
80 POSITION 24,19:? "to change that"
81 POSITION 24,20:? "color.":DELAY=200:GOSUB 700
85 FOR I=0 TO 254 STEP 10:X=5^3:POKE 704,I:POKE 705,I:NEXT I:REM X=5^3 is added here simply to add a pause
90 POKE 704,80:POKE 705,80
100 GOSUB 700
102 ? CHR$(125):POSITION 2,3
105 ? "And it's easy to"
106 ? "go back to the regular"
107 ? "playfield color."
108 GOSUB 900
110 POKE 53248,0:POKE 53249,0:REM MOVE PLAYERS OFF SCREEN
115 GOSUB 700
117 ? CHR$(125):? :? :POSITION 2,3
120 ? "You can also fill"
125 ? "the entire screen"
130 ? "with all 5 players."
135 DELAY=400:GOSUB 700
140 ? :? "Like so:":X=X^3
150 GOSUB 1000:REM MOVE ALL 5 PLAYERS ONTO SCREEN
230 GOSUB 700:? CHR$(125):POSITION 2,3
232 ? "The playfield is now hiding"
234 ? "behind the players.":? :?
235 DELAY=250:GOSUB 700
236 ? "Now I'll put it in front"
238 ? "of the players."
239 DELAY=100:GOSUB 700:POKE 623,4+16
240 DELAY=500:GOSUB 700:? CHR$(125):POSITION 2,10:? "Next, when you press a key,"
241 ? "I'll shrink the playfield"
242 ? "for a moment by poking ":? "Location 559 with 33."
243 GOSUB 900:? CHR$(125):POKE 559,1+32:DELAY=200:GOSUB 700:POKE 559,2+32
244 ? :? :? "Next, let's set each player"
245 ? "to a different color."
246 GOSUB 900:POKE 559,2+32
247 POKE 704,16:POKE 705,64:POKE 706,96:POKE 707,144:POKE 711,192:REM SET PLAYERS TO DIFFERENT COLORS
248 ? CHR$(125):GOSUB 700
250 POSITION 2,3:? "Notice that players "
252 ? "0-3 are behind the playfield"
254 ? "but Player 4 (at right)"
255 ? "is in front of the playfield."
260 GOSUB 900
265 ? CHR$(125):POKE 623,4+16:REM SET PRIORITIES AND ENABLE 5TH PLAYER
270 POSITION 2,3:? "As you can see, Player 4"
272 ? "(the one made up of missiles)"
274 ? "always displays in front of"
276 ? "all playfields.":GOSUB 900:? CHR$(125):POSITION 2,3
277 ? "Let's get rid of the ":? "playfield again.":GOSUB 900:? CHR$(125):POKE 623,1+16:POSITION 2,9
278 ? " Playfield now hiding.":GOSUB 900
280 ? CHR$(125):POKE 623,4+16:POSITION 2,3
282 ? "In conclusion, here's an"
283 ? "example of how you can"
284 ? "overlap players to create"
286 ? "a multicolored object."
290 GOSUB 900:? CHR$(125)
292 POKE 623,1+16+32:REM SET PRIORITY,ENABLE 5TH PLAYER, CREATE MULTICOLORED OBJECT WHEN PLAYERS OVERLAP
299 REM SET PLAYERS 0 AND 1 TO OVERLAP
300 POKE 53248,48:REM PLAYER 0
310 POKE 53249,48+16:REM OVERLAP
320 POKE 53250,0:REM MOVE OFF SCREEN
350 POKE 53251,0
360 POKE 53252,0
370 POKE 53253,0
380 POKE 53254,0
390 POKE 53255,0
400 POSITION 18,10:? "The three colors"
410 POSITION 18,11:? "at left were "
420 POSITION 18,12:? "produced by"
425 POSITION 18,13:? "Players 0 & 1."
430 POSITION 18,15:? "You can use the"
432 POSITION 18,16:? "same idea to"
434 POSITION 18,17:? "make a multi-"
436 POSITION 18,18:? "colored flying"
438 POSITION 18,19:? "spacecraft!"
440 POSITION 18,22:? "END OF PROGRAM"
499 GOTO 499
500 POKE 623,1+16:REM DISPLAY PLAYERS IN FRONT OF PLAYFIELD, ENABLE 5TH PLAYER
505 POKE 53256,3:POKE 53257,3:POKE 53258,3:POKE 53259,3:REM SET ALL PLAYERS TO QUADRUPLE WIDTH
507 POKE 53260,192+48+12+3:REM SET ALL MISSILES TO QUARUPLE WIDTH
510 POKE 704,80:REM SET PLAYER 0 COLOR
512 POKE 705,80:REM PLAYER 1 COLOR
514 POKE 706,80:REM PLAYER 2 COLOR
516 POKE 707,80:REM PLAYER 3 COLOR
518 POKE 711,80:REM PLAYER 4 COLOR
559 REM POKE DATA DIRECTLY INTO THE THE PLAYER GRAPHIC REGISTERS
560 POKE 53261,255:REM IMAGE FOR PLAYER0
570 POKE 53262,255:REM PLAYER1
575 POKE 53263,255:REM PLAYER 2
580 POKE 53264,255:REM PLAYER 3
582 POKE 53265,255:REM PLAYER 4!
699 RETURN
700 FOR I=1 TO DELAY:NEXT I
710 RETURN
800 IF PEEK(764)<>255 THEN POKE 764,255:RETURN
810 GOTO 800
900 POSITION 2,22:? "TAP ANY KEY":? "TO CONTINUE":GOSUB 800
910 POSITION 2,21:? " ":? " "
920 RETURN
999 REM MOVE ALL PLAYERS ON SCREEN
1000 POKE 53248,48:REM HOR. POS. P0
1010 POKE 53249,48+32
1020 POKE 53250,48+2*32
1030 POKE 53251,48+3*32
1040 POKE 53252,48+4*32
1050 POKE 53253,48+(4*32)+8
1060 POKE 53254,48+(4*32)+16
1070 POKE 53255,48+(4*32)+24
1080 RETURN
