User Tools

Site Tools


Translations of this page:



en:breakout

BREAKOUT

Info

Author Norman Barrington
Computer Amstrad PCW 8256 / 8512 / 9512
Year ????
Gender Arcade
Controls Keyboard
Languages English
Status Preserved

Screenshots

Description

This is a PCW implementation of the well-known arcade game. We have five balls with which we must break the brick wall that we will find on our right. Each brick that we break will earn us different points. If after five balls our score is more than 100, we will be awarded an extra ball for every 100 points we have earned. The score of each brick is shown to us at the top of them. The program is designed to allow the ball to bounce around the screen in a random way inside the bricks. Each collision of the ball on the bricks produces a musical note and each color produces a different tone, which can result in a musical experience.

The number of remaining balls are indicated at the top right of the screen. Each new ball is shot into the game from the front of the bat, so the position of the bat will affect how the ball enters play, and of course we will have to move the bat up or down (with the arrow keys) in order to keep the ball in play.

To exit the game just press the exit key.

Listing

  • Listing 1 - BREAKOUT.BAS
10 DIM b(8,10):h!=HIMEM:MEMORY &HBFFE:FOR x=&HC070 TO &HC098:READ pk:POKE x,pk:NEXT x
20 DATA 243,62,129,211,241,62,130,211,242,175,95,103,22,184,58,153,192,111,41,41
30 DATA 41,25,17,154,192,235,1,8,0,237,176,62,133,211,241,62,134,211,242,251,201
40 CHAR=247:count=9:ch=CHAR:WHILE char<count+ch:POKE &HC099,(char):FOR r=1 TO 8:READ b(r,ct):POKE &HC099+r,(b(r,ct))
50 NEXT:cl=&HC070:CALL cl:char=char+1:WEND:MEMORY h!:CHAIN "BREAKOUT.OVL
55 DATA 0,24,126,255,255,126,24,0
60 DATA 0,255,129,129,129,129,255,0, 0,68,17,68,17,68,17,0
70 DATA 0,255,170,85,170,85,255,0, 0,255,219,219,219,219,255,0,0,255,255,255,255,255,255,0
80 DATA  0,255,204,51,204,51,255,0
90 DATA 0,255,153,51,102,204,255,0, 0,255,204,102,51,153,255,0
  • Listing 2 - BREAKOUT.OVL
10 OPTION RUN
20 'SAVE  "breakout.ovl
30 DEFINT a-z:DIM a(30,90):GOSUB 600:a=1:play=5:cx=15:cx1=12:d=0.1
40 DEF FNat$(x,y)=CHR$(27)+"Y"+CHR$(32+x)+CHR$(32+y)
50 con$=CHR$(27)+"e":coff$=CHR$(27)+"f":PRINT coff$ 
60 cls$=CHR$(27)+"E"+CHR$(27)+"H":ch$=CHR$(27)+"H"
70 rev$=CHR$(27)+"p":rof$=CHR$(27)+"q"
80 bat$=CHR$(27)+"p "+CHR$(8)+CHR$(10)+" "+CHR$(27)+"q"
90 bl$=CHR$(247)
100 PRINT CHR$(27)+"0":PRINT cls$
110 PRINT FNat$(3,0)rev$ "SCORES PER LINE:"+SPACE$(72)
120 PRINT FNat$(25,0) SPACE$(88) rof$
130 PRINT FNat$(15,1)bat$:RANDOMIZE(PEEK(64504!))
135 PRINT FNat$(29,18) rev$ " **** B R E A K O U T ! **** by Norman Barrington       "rof$
140 FOR x=6 TO 24 :FOR y=53 TO 84 STEP 2:a(x,y)=(INT(y/4))-12:PRINT FNat$(x,y)CHR$(247+a(x,y)):NEXT:NEXT
150 FOR y=53 TO 84 STEP 2:l$=RIGHT$(STR$(INT(y/4)-12),1):PRINT rev$ FNat$(4,y)l$ rof$:NEXT
160 x=cx:y=2:a=1:PRINT rev$ FNat$(2,55)"BALLS REMAINING:"rof$:nb=((play+extr)-(used+1)):IF nb>0 THEN FOR i=1 TO nb:PRINT FNat$(2,71+(i*2))bl$+"  ":NEXT ELSE PRINT FNat$(2,71)"       " 
170 PRINT rev$
171 PRINT FNat$(4,0)"SCORE"+ROF$
180 IF bl=1 THEN GOSUB 510
190 a$=INKEY$:IF a$="" THEN 230 ELSE z=INSTR(CHR$(30)+CHR$(31)+CHR$(27),a$)
200 ON z GOTO 210,220,520:GOTO 230
210 IF cx<23 THEN cx=cx+1:PRINT FNat$(cx,1)bat$ FNat$(cx-1,1)" ":GOTO 230 ELSE 230
220 IF cx>6 THEN cx=cx-1:PRINT FNat$(cx,1)bat$ FNat$(cx+2,1)" ":GOTO 230 ELSE 230
230 ON a GOTO 250,290,330,390
240 '--------------------------------------------------
250 x=x-1:y=y+1:IF a(x,y) THEN PRINT FNat$(x+1,y-1)" ":GOSUB 490:GOTO 180
260 IF x<6 THEN a=2:bl=1:ELSE IF y>88 THEN GOTO 450
270 PRINT FNat$(x+1,y-1)" " FNat$(x,y) bl$:GOTO 180
280 '--------------------------------------------------
290 x=x+1:y=y+1:IF a(x,y) THEN PRINT FNat$(x-1,y-1)" ":GOSUB 490:GOTO 180
300 IF x>24 THEN a=1:bl=1 ELSE IF y>88 THEN GOTO 450
310 PRINT FNat$(x-1,y-1)" " FNat$(x,y) bl$:GOTO 180
320 '--------------------------------------------------
330 x=x+1:y=y-1:IF a(x,y) THEN PRINT FNat$(x-1,y+1)" ":GOSUB 490:GOTO 180
340 IF x>24 THEN a=4:bl=1 ELSE IF y<2 THEN y=y+1:x=x-1:GOSUB 440:GOTO 460
350 PRINT FNat$(x-1,y+1)" " FNat$(x,y)bl$
360 IF y=2 AND ABS(x-cx)<2 THEN a=2:GOSUB 510:GOSUB 440:y=y+1
370 GOTO 180
380 '--------------------------------------------------
390 x=x-1:y=y-1:IF a(x,y) THEN PRINT FNat$(x+1,y+1)" ":GOSUB 490:GOTO 180
400 IF x<6 THEN a=3:bl=1 ELSE IF y<2 THEN y=y+1:x=x+1:GOSUB 440:GOTO 460
410 PRINT FNat$(x+1,y+1)" " FNat$(x,y) bl$
420 IF y=2 AND ABS(x-cx)<2 THEN a=1:GOSUB 510:GOSUB 440:y=y+1
430 GOTO 180
440 PRINT FNat$(x,y)" ":RETURN
450 PRINT FNAT$(15,30)rev$"***  B R E A K O U T !  ***":FOR note=0 TO 9:GOSUB 640:NEXT:GOTO 520
460 FOR note=9 TO 0 STEP -1:GOSUB 640:NEXT:used=used+1:IF (play+extr-used)>0 THEN GOTO 160
470 extr=points\100:IF (play+extr-used)>0 THEN PRINT rev$ FNat$(2,25)extr" EXTRA BALL(S) AWARDED!"rof$:GOTO 160
480 PRINT FNat$(15,30)rev$"        END  OF  GAME      "rof$:GOTO 520
490 PRINT FNat$(x,y)bl$:a=INT(RND*4)+1:note=a(x,y):a(x,y)=0:GOSUB 640
500 points=points+note:PRINT rev$ FNat$(2,10) USING "SCORE: #### ";points:PRINT rof$:RETURN
510 d=0.01:note=0:GOSUB 640:bl=0:d=0.1:RETURN
520 PRINT FNAT$(16,30)rev$" DO YOU WANT ANOTHER TURN? "rof$
525 WHILE INKEY$<>"":PRINT CHR$(7):WEND
530 X$=UPPER$(INPUT$(1)):MEMORY h!:IF X$="Y" THEN RUN ELSE END
540 DATA 229,213,197,221,229,42,27,192,237,91,25,192,205,29,192,62
550 DATA 12,211,248,221,225,193,209,225,201,0,0,0,0,243,125,203
560 DATA 61,203,61,47,230,3,79,6,0,221,33,49,192,221,9,62
570 DATA 11,0,0,0,4,12,13,32,253,14,63,5,32,248,60,254
580 DATA 13,32,2,61,61,211,248,68,79,254,11,32,9,122,179,40
590 DATA 9,121,77,27,221,233,77,12,221,233,251,201
600 h!=HIMEM:MEMORY &HBFFF:FOR n=&HC000 TO &HC05B:READ d:POKE n,d:NEXT
610 Az=&HC000:Bz=&HC019:Cz=&HC01B
620 DEFSNG d,e,f:DIM e(10):FOR n=0 TO 9:READ f:e(n)=f:NEXT:RETURN
630 DATA 189.8765,210,234.4015,254.612,284,318,351,372,415,470
640 f2=e(note)*3.456:t=3500000!/(f2*2):t=INT(t/4-30.125)
650 f2=INT(f2*d)
660 POKE Bz,f2-256*INT(f2/256):POKE Bz+1,INT(f2/256)
670 POKE Cz,t-256*INT(t/256):POKE Cz+1,INT(t/256):CALL Az:RETURN

Controls

       ↑ = UP
       ↓ = DOWN
    EXIT = LEAVE GAME

Loading the program

 1.- Insert the CP/M disc on side 2
 2.- Write BASIC and wait for it to load
 3.- Remove the CP/M disk and insert the disk containing the Breakout game
 4.- Type run "Breakout" and press the "ENTER" key

Download

  • Breakout (game in dsk format, compressed with zip)
en/breakout.txt · Last modified: 2022/06/30 02:34 by jevicac