1 rem game prod.by - "limil"+"10.12.2014"
2 rem sound by - "05_Klyanch-Constellation_6AM_Rising_Star_(Original_Mix)_[Trance_Session_Episode_25].mid"
10 rem file:///e:/kor1/
20 sleep%=0:file$=""
30 scw%=scw(0):sch%=sch(0)
40 wos=(screenwidth(0) / 2)-1
50 hos=(screenheight(0) / 2)-1
54 wos1=(screenwidth(0) / 2)-10
55 hos1=(screenheight(0) / 2)-10
60 setcolor 0,0,0:fillrect 0,0,scw%,sch%
70 ony%=0
80 mspov%=MILLISECONDS(0)
81 mslife%=MILLISECONDS(0)
82 mslifedg%=MILLISECONDS(0)
83 msload%=MILLISECONDS(0)

100 kor$="k":kor%=1:korabl$="k"
110 korx%=scw%/2-163:kory%=sch%/2-49
120 cur$="cur":cur%=1:cursor$="cur"
130 curx%=korx%+145:cury%=kory%+39
140 meteor$="st"
150 load%=0:setfont 1
160 life%=100:snyal%=0:prop%=0

170 met%=8:bomb%=-1

210 for pov%=-2 to 2
211 for i%=1 to 5
212 gl kor$+str$(pov%)+str$(i%),file$+"k"+str$(pov%)+str$(i%)+".png"
213 next i%
214 next pov% 
215 pov%=0
216 sg korabl$,kor$+str$(pov%)+str$(kor%)

300 for i%=1 to 5
301 gl cur$+str$(i%),file$+"cur"+str$(i%)+".png"
302 next i%
303 sg cursor$,"cur"+str$(cur%)

320 REM "Параметры отображения 3д"
321 prp=14
322 suj=0.06

330 REM "------------------------------------------"
340 n%=30

350 dim x(n%):dim y(n%):dim z(n%)
360 dim xd(n%):dim yd(n%):dim rgb%(n%)
365 dim fonx(n%):dim fony(n%):dim rgb1(n%)
370 dim stx(met%):dim sty(met%):dim stz(met%)
380 dim stxd(met%):dim styd(met%):dim st%(15)
383 dim lupa%(met%):dim dvb%(met%)

400 rem "метеорит"
401 for i%=0 to met%-1
402 for pov%=0 to 14 
403 st%(pov%)=0
404 gl "st"+str$(i%)+str$(pov%),file$+"st"+str$(pov%)+".png"
405 next pov%
406 stx(i%)=rand(0-scw%,scw%+scw%):sty(i%)=rand(0-sch%,sch%+sch%):stz(i%)=rand(500,600)
407 lupa%(i%)=0
408 next i%
409 pov%=0

450 for i%=0 to n%-1
451 REM "--------------------------------------"
452 fonx(i%)=rand(0,scw%):fony(i%)=rand(0,sch%):rgb1(i%)=rand(10,60)
453 x(i%)=rand(0-scw%,scw%+scw%):y(i%)=rand(0-sch%,sch%+sch%):z(i%)=rand(200,300)
454 rgb%(i%)=0
455 next i%

460 for bw%=0 to met%-1
461 for nom%=0 to 3
462 for zum%=0 to 14
463 gl "bomb"+str$(bw%)+str$(zum%)+str$(nom%),file$+str$(zum%)+str$(nom%)+".png"
464 next zum%
465 next nom%
466 next bw%

500 pw file$+"05_Klyanch-Constellation_6AM_Rising_Star_(Original_Mix)_[Trance_Session_Episode_25].mid"

510 REM "--------------------------------------------------------"
520 REM "Рисуем координатную ось"
525 setcolor 0,0,0
526 fillrect 0,0,scw%,sch%

600 if up(0) then dvig%=1:ony%=ony%-1
601 if right(0) then dvig%=2:pov%=0
602 if down(0) then dvig%=3:ony%=ony%+1
603 if left(0) then dvig%=4:pov%=0
604 if fire(0) then puldvig%=1:load%=load%-rand(1,20)
610 if cury%>kory%+70 then cury%=kory%+70
611 if cury%<kory%+7 then cury%=kory%+7
612 if curx%>korx%+155 then curx%=korx%+155
613 if curx%<korx%+135 then curx%=korx%+135

620 if ony%<-6 then pov%=pov%-1:ony%=0
630 if ony%>6 then pov%=pov%+1:ony%=0
640 if pov%<-2 then pov%=-2
650 if pov%>2 then pov%=2

660 kor%=kor%+1
670 if kor%>5 then kor%=1

680 if dvig%=0 then pov%=0:sg korabl$,kor$+str$(pov%)+str$(kor%):curx%=korx%+145:cury%=kory%+39
690 if dvig%=1 then sg korabl$,kor$+str$(pov%)+str$(kor%):cury%=cury%-2
700 if dvig%=2 then sg korabl$,kor$+str$(pov%)+str$(kor%):curx%=curx%+1
710 if dvig%=3 then sg korabl$,kor$+str$(pov%)+str$(kor%):cury%=cury%+2
720 if dvig%=4 then sg korabl$,kor$+str$(pov%)+str$(kor%):curx%=curx%-1

730 if puldvig%=1 then sg cursor$,"cur"+str$(cur%):cur%=cur%+1
740 if fire(0) and cur%>3 then cur%=3
750 if cur%>5 then cur%=1:puldvig%=0
 
1250 REM "----------------------------------------"
1260 REM "А теперь рисуем наши точки"
1270 for i%=0 to n%-1
1271 REM "--------------------------------------"
1272 REM "Переводим xyz в координаты xd и yd"
1273 xd(i%)=wos+x(i%)*(prp / (prp + z(i%)*suj)):yd(i%)=hos-y(i%)*(prp / (prp + z(i%)*suj))
1280 if dvig%=1 then y(i%)=y(i%)-1:fony(i%)=fony(i%)+0.5
1281 if dvig%=2 then x(i%)=x(i%)-1:fonx(i%)=fonx(i%)-0.5
1282 if dvig%=3 then y(i%)=y(i%)+1:fony(i%)=fony(i%)-0.5
1283 if dvig%=4 then x(i%)=x(i%)+1:fonx(i%)=fonx(i%)+0.5
1284 z(i%)=z(i%)-2:rgb%(i%)=rgb%(i%)+1
1285 if xd(i%)>scw%+scw% or xd(i%)<0-scw% or yd(i%)>sch%+sch% or yd(i%)<0-sch% then x(i%)=rand(-240,240):y(i%)=rand(-320,320):z(i%)=rand(300,400):rgb%(i%)=0
1286 if fonx(i%)>scw% then fonx(i%)=0
1287 if fonx(i%)<0 then fonx(i%)=scw%
1288 if fony(i%)>sch% then fony(i%)=0
1289 if fony(i%)<0 then fony(i%)=sch%
1290 setcolor rgb1(i%),rgb1(i%)+20,rgb1(i%)+40:plot fonx(i%),fony(i%)
1293 if rgb%(i%)>255 then rgb%(i%)=255
1294 setcolor rgb%(i%),rgb%(i%),rgb%(i%):plot xd(i%),yd(i%)
1300 next i%

1400 REM "------------------------------------------"
1420 for m%=0 to met%-1 
1440 if dvig%=1 then sty(m%)=sty(m%)-3
1450 if dvig%=2 then stx(m%)=stx(m%)-3
1460 if dvig%=3 then sty(m%)=sty(m%)+3
1470 if dvig%=4 then stx(m%)=stx(m%)+3
1480 stz(m%)=stz(m%)-3
1490 if stxd(m%)>scw%+scw% or stxd(m%)<0-scw% or styd(m%)>sch%+sch% or styd(m%)<0-sch% then stx(m%)=rand(-240,240):sty(m%)=rand(-320,320):stz(m%)=rand(500,600):st%(m%)=0:prop%=prop%+1
1500 if st%(m%)<14 then lupa%(m%)=lupa%(m%)+1
1510 if lupa%(m%)>12 then lupa%(m%)=0:st%(m%)=st%(m%)+1:stx(m%)=stx(m%)-1:sty(m%)=sty(m%)+1
1520 if st%(m%)>14 then st%(m%)=14
1523 REM "Переводим stxstystz в координаты stxd и styd"
1525 stxd(m%)=wos1+stx(m%)*(prp / (prp + stz(m%)*suj)):styd(m%)=hos1-sty(m%)*(prp / (prp + stz(m%)*suj))

1530 dg meteor$+str$(m%)+str$(st%(m%)),stxd(m%),styd(m%)

1534 if fire(0) and dvb%(m%)=0 and life%>1 and curx%+4>stxd(m%) and curx%+4<stxd(m%)+20 and cury%+4>styd(m%) and cury%+4<styd(m%)+20 then dvb%(m%)=1

1535 REM "--------------------------------------------------------"
1536 if dvb%(m%)=1 then bomb%=bomb%+1:dg "bomb"+str$(m%)+str$(st%(m%))+str$(bomb%),stxd(m%),styd(m%)
1537 if bomb%>3 then snyal%=snyal%+1:life%=life%+3
1538 if bomb%>3 then stx(m%)=rand(-240,240):sty(m%)=rand(-320,320):stz(m%)=rand(500,600):st%(m%)=0
1539 if dvb%(m%)=1 and bomb%>3 then bomb%=-1:dvb%(m%)=0
 
1570 next m%

2000 dvig%=0
2010 sm korabl$,korx%,kory%
2020 sm cursor$,curx%,cury%

3000 rem vostanovlenie jizni
3010 if (MILLISECONDS(0)-msload%)>200 then msload%=MILLISECONDS(0):load%=load%+1
3020 if load%>100 then load%=100
3030 if load%<0 then load%=0

3040 if (MILLISECONDS(0)-mslife%)>300 then mslife%=MILLISECONDS(0):life%=life%-1
3050 if life%<0 then life%=0:goto 5000
3060 if life%>100 then life%=100

3500 setcolor 60,60,60:drawrect scw%-7,2,4,101
3505 setcolor 60,60,60:drawrect scw%-7,sch%-106,4,101
3510 setcolor 0,40,150:fillrect scw%-6,3,3,load%
3520 setcolor 150,40,40:fillrect scw%-6,sch%-105,3,life%

3523 rem goto 4000

3525 if gamea(0) then prp=prp-1
3530 if gameb(0) then prp=prp+1
3535 if gamec(0) then suj=suj-0.1
3540 if gamed(0) then suj=suj+0.1
3543 ds str$(prp),0,25
3545 ds str$(suj),0,0

4000 REM "-------------------------------------------"
4100 repaint
4500 goto 510

5000 setcolor 0,100,100
5005 ds "YBITO - "+str$(snyal%),20,20
5010 ds "nponyck - "+str$(prop%),20,50
5020 if fire(0) then life%=100:goto 510
5030 if gamea(0) then end
5040 repaint:goto 5020

8001 rem game prod.by - "limil"+"10.12.2014"



