\START92\ \COMMENT=StarBlaster by Rick Coogle \NAME=blast \FILE=BLAST.92P () Prgm Local n1,n2,s1,s2,w1,w2,rd,rf,rk,yn,i,rs,imp,hs,wf,k,k2,ob,bh,md,smb,mov Define mov(s,r,d)=Prgm Local cs "p"&s&"c"\->\cs AndPic #("nul"&s),r,#cs #cs+10*d\->\#cs If #cs>220 Then 51\->\#cs ElseIf #cs<50 Then 221\->\#cs EndIf XorPic #("ship"&s),r,#cs EndPrgm Define bh()=Prgm Local i For i,0,80 PxlCrcl 51,119,i EndFor For i,80,0,\(-)\1 PxlCrcl 51,119,i,0 EndFor EndPrgm Define smb(x,y)=Prgm Local i,j For i,0,5 PxlCrcl x,y,i For j,1,5 EndFor PxlCrcl x,y,i,0 EndFor EndPrgm Define imp(x,y)=Prgm Local i For i,1,20 PxlCrcl x,y,i PxlCrcl x,y,i,0 EndFor For i,20,1,\(-)\1 PxlCrcl x,y,i PxlCrcl x,y,i,0 EndFor EndPrgm Define hs(n,s)=Prgm Local i,t,l1,l2 hl[1]\->\l1 hl[2]\->\l2 For i,1,10 (hl[2])[i]\->\t If s>t Then NewData hl,augment(mid(l1,1,i-1),augment({n},mid(l1,i+1))),augment(mid(l2,1,i-1),augment({s},mid(l2,i+1))) Text "You have a high score!" Exit EndIf EndFor Disp "\starburst\-HIGH SCORES-\starburst\" For i,1,10 If (hl[1])[i]=0 Exit Disp (hl[1])[i]&" "&string((hl[2])[i]) If i=5 Pause EndFor EndPrgm Define ob(x,y)=Prgm Local i For i,2,30,2 PxlCrcl x,y,i If x+i\<=\102 Then PxlCrcl x+i,y-i,5 If y+i<238 PxlCrcl x+i,y+i,5 EndIf If i\<=\x Then PxlCrcl x-i,y-i,5 If y+i<238 PxlCrcl x-i,y+i,5 EndIf EndFor EndPrgm Define md(h,t)=Prgm Local i,d,t1 If t=1 Then 3\->\d ElseIf t=2 Then #("h"&string(h))\->\d EndIf If h=1 Then h1\->\t1 h1-d\->\h1 Else h2\->\t1 h2-d\->\h2 EndIf For i,t1,t1-d,\(-)\1 PxlOff i+when(h=2,0,51),3 EndFor EndPrgm Lbl start setFold(starblst) Unlock hl 0\->\w1 0\->\w2 0\->\wf 0\->\s1 0\->\s2 0\->\rd setMode("angle","radian") FnOff ClrDraw ClrIO \(C)\The ? here is to be the (r) symbol Dialog Title "StarBlaster? v7.7e by Rick Coogle" Text "Enter names:" Text "(2 to 6 length)" Request "Player 1",n1 Request "Player 2",n2 DropDown "1 Player Mode",{"Off","On"},rs EndDlog If ok=0 Goto reset If rs=2 Then true\->\rf {258,32,61}\->\rk "CPU"\->\n2 Else false\->\rf EndIf Dialog DropDown "View Tutorial?",{"Yes","No"},yn EndDlog If yn=1 help() Text "Get ready and good luck\...\" Lbl rnd setGraph("axes","off") ClrDraw rd+1\->\rd If rd>3 Then If w1>w2 Then "1"\->\wf ElseIf w1\wf EndIf Goto f EndIf Text "Round "&string(rd) 101\->\p1c 101\->\p2c 0\->\k 0\->\k2 45\->\h1 45\->\h2 PxlText "1UP:",70,10 PxlText n1,79,10 PxlText "2UP:",0,10 PxlText n2,9,10 RclPic pmeter,0,1 For i,1,50 PxlOn i,3 PxlOn i+47,3 EndFor Loop PxlText string(s1),88,10 PxlText string(s2),18,10 PxlVert 50 RplcPic ship1,75,p1c RplcPic ship2,8,p2c If k=13 and p1c<221 Then For i,0,75,17 PxlLine 75,p1c+18,75-i,p1c+18 EndFor For i,0,75,17 PxlLine 75,p1c+18,75-i,p1c+18,0 EndFor If p1c=p2c Then smb(20,p2c+15) md(2,1) s1+rand(20)\->\s1 If h2=0 Then ob(20,p2c+15) w1+1\->\w1 Goto rnd EndIf EndIf EndIf If k=32 or k2=32 Then For i,0,64,15 PxlLine 38,p2c+16,38+i,p2c+16 EndFor For i,0,64,15 PxlLine 38,p2c+16,38+i,p2c+16,0 EndFor If p2c=p1c Then smb(85,p1c+16) md(1,1) s2+rand(20)\->\s2 If h1=0 Then ob(85,p1c+16) w2+1\->\w2 Goto rnd EndIf EndIf EndIf If k=340 mov("1",75,1) If k=337 mov("1",75,\(-)\1) If k=61 or k2=61 mov("2",8,1) If k=258 or k2=258 mov("2",8,\(-)\1) If k=113 Then Text "Let's fly another time!" Goto reset EndIf If k=104 help() If k=112 Text "PAUSED" If k=261 Then For i,1,50 RplcPic miss1,50-i,p1c+10 EndFor XorPic miss1,0,p1c+10 If p1c=p2c Then imp(20,p2c+15) md(2,2) mbst() s1+1000\->\s1 w1+1\->\w1 Goto rnd EndIf EndIf If k=136 Then For i,0,62 RplcPic miss2,40+i,p2c+9 EndFor XorPic miss2,102,p2c+9 If p2c=p1c Then imp(85,p1c+15) md(1,2) mbst() s2+1000\->\s2 w2+1\->\w2 Goto rnd EndIf EndIf If k=114 Then Text "Resetting game\...\" Goto start EndIf If k=260 or k=98 Then bh() If when(k=260,true,false) Then s1+2000\->\s1 RclPic ship1,75,p1c "1"\->\wf Exit Else s2+2000\->\s2 RclPic ship2,8,p2c "2"\->\wf Exit EndIf EndIf If k=98 Then tr(p2c+16) EndIf getKey()\->\k If rf rk[rand(3)]\->\k2 EndLoop Lbl f Dialog Title "Player "&wf&" Wins!" Text "Score: "&string(#("s"&wf)) DropDown "Play again?",{"Yes","No"},yn EndDlog If #("n"&wf)\!=\"CPU" hs(#("n"&wf),#("s"&wf)) If yn=1 Goto start Lbl reset DelVar h1,h2,p1c,p2c Lock hl setMode("graph","function") setGraph("axes","on") setFold(main) EndPrgm \STOP92\