10 num%=30: H=SCREENWIDTH(0):W=SCREENHEIGHT(0)
11 COL=255:G=COL:R=0:B=0:N%=0:X=5.5:Y=1
20 KH=H/10-2:KW=W/20:C%=0:C1%=0:C2%=0:DX=H/2-20.5:DY=W-7
21 BX=DX+20:BY=DY-6:A=-1:A1=-1:BA%=3
24 rem Ðèñóåì áëîêè
25 FOR I%=0 TO 2
29 SETCOLOR R,G,B
30 FILLRECT 0,0,KH,KW
31 GELGRAB STR$(I%),0,0,KH,KW
32 IF I%=0 THEN R=COL:G=0:B=COL
33 IF I%=1 THEN R=0:G=0:B=COL
34 CLS:NEXT I%
40 FOR I%=0 TO 3
42 SETCOLOR R,G,B
43 FILLARC 0,0,5,5,0,360
44 GELGRAB "bal"+STR$(I%),0,0,5,5
45 IF I%=0 THEN G=COL:R=0:B=0
46 IF I%=1 THEN R=COL:G=0:B=COL
47 IF I%=2 THEN R=COL:G=COL:B=0
50 NEXT I%
51 CLS
52 rem äîñêà
60 SETCOLOR 0,0,0
61 FILLRECT 1,1,40,5
62 GELGRAB "dos",0,0,41,6
63 CLS:SPRITEGEL "dos","dos"
64 SPRITEMOVE "dos",-100,-100
70 rem ìàñèâû ñòðîê
80 DIM ZEL$(10)
90 DIM ROZ$(10)
100 DIM SIN$(10)
101 rem îòðèñîâêà áëîêîâ
110 FOR I%=0 TO 29
120 SPRITEGEL "bloc"+STR$(I%),STR$(N%)
123 IF N%=0 THEN ZEL$(C%)="bloc"+STR$(I%):C%=C%+1
124 IF N%=1 THEN ROZ$(C1%)="bloc"+STR$(I%):C1%=C1%+1
125 IF N%=2 THEN SIN$(C2%)="bloc"+STR$(I%):C2%=C2%+1
126 IF I%=9 THEN N%=1
127 IF I%=19 THEN N%=2
129 SPRITEMOVE "bloc"+STR$(I%),-100,0
130 NEXT I%
140 FOR E%=0 TO 29
200 SPRITEMOVE "bloc"+STR$(E%),X,Y
201 X=X+KH+1
202 IF E%=9 THEN X=5.5:Y=KW+2
203 IF E%=19 THEN X=5.5:Y=KW*2+3
210 NEXT E%
211 rem ñàìà èãðà
240 SPRITEMOVE "dos",DX,DY
250 IF LEFT(0) THEN DX=DX-2
251 IF DX<0 THEN DX=0
260 IF RIGHT(0) THEN DX=DX+2
261 IF DX>H-42 THEN DX=H-42
270 SPRITEGEL "bal","bal"+STR$(BA%)
271 SPRITEMOVE "bal",BX,BY
280 BX=BX+A
281 BY=BY+A1
282 IF BX<0 THEN A=1
283 IF BY<0 THEN A1=1
284 IF BX>H-5 THEN A=-1
285 IF BY>W+20 THEN A1=-1
290 IF SPRITEHIT("bal","dos") THEN A1=-1
291 FOR C2%=0 TO 9
292 IF SPRITEHIT("bal",SIN$(C2%)) THEN BA%=0
293 IF SPRITEHIT("bal",ROZ$(C2%)) THEN BA%=2
294 IF SPRITEHIT("bal",ZEL$(C2%)) THEN BA%=1
299 NEXT C2%
300 FOR I%=0 TO 29
301 IF SPRITEHIT("bal","bloc"+STR$(I%)) THEN SPRITEMOVE "bloc"+STR$(I%),-100,-200:A1=1:num%=num%-1
350 NEXT I%
360 if num%=0 then end
1000 SLEEP 2:GOTO 240
