'ProgramMode:RUN 'BallGame 0.99 ' Orginal ' by PierrotLL "BALLGAME(C.Basic ver)" " Orginal Add-in Game " " (c)2010 PierrotLL " " UP _#E692_ " " DOWN _#E693_ [EXIT]" " Press [EXE] to start"Disps '#CBINT '#_Mat _0 'Ball Pattern [[ 0B01110000, 0B11111000, 0B11111000, 0B11111000, 0B01110000 ]]->Mat K.B [[ 0B01110000, 0B11011000, 0B10001000, 0B11011000, 0B01110000 ]]->Mat W.B 'X[n]=x 'Y[n]=y 'x[n]=dx 'y[n]=dy 'C[n]=color {100,1}->Dim Mat X.L {100,1}->Dim Mat Y.L {100,1}->Dim Mat x.L {100,1}->Dim Mat y.L {100,1}->Dim Mat C.L '_Ran#_ init Ran#2 10->M 4->N 16->G 32-G/2->Y 0->W 'NewBall For 1->I To 99 Do RanInt#(30,1249)->X[I] LpWhile X[I]>57 And X[I]<70 RanInt#(30,609)->Y[I] Do RanInt#((-)5,5)->x[I] LpWhile Abs x[I]<3 Do RanInt#((-)5,5)->y[I] LpWhile Abs y[I]<3 RanInt#(0,1)->C[I] Next %->S S->R 0->F 0->P ViewWindow 0,127,0,63,0,0 '--Main Loop-- Do %->C Getkey->K K=28=>Y>2=>Dsz Y K=37=>Y<62-G=>Isz Y 'balls movements For 1->I To M X[I]+x[I]->X[I] Y[I]+y[I]->Y[I] If X[I]<20:Then 20->X[I] Abs x[I]->x[I] IfEnd If X[I]>1220:Then 1220->X[I] (-)Abs x[I]->x[I] IfEnd If Y[I]<20:Then 20->Y[I] Abs y[I]->y[I] IfEnd If Y[I]>580:Then 580->Y[I] (-)Abs y[I]->y[I] IfEnd If ((Y[I]<(Y*10)) Or (Y[I]+30>(10*(Y+G-1)))) Or W:Then Intg (X[I]/10)=58=>(-)Abs x[I]->x[I] Intg (X[I]/10)=66=>Abs x[I]->x[I] IfEnd If (X[I]>580) And (X[I]<660):Then Y[I]<=(Y*10)=>Abs y[I]->y[I] (Y[I]+30)>=(10*(Y+G-1))=>(-)y[I]->y[I] IfEnd Next 'test if win W=0=>1->W For 1->I To M If C[I]:Then X[I]>590=>0->W Else X[I]<650=>0->W IfEnd Next 'Drawing Cls F-Line 1,1,1,62: F-Line 126,1,126,62: F-Line 1,1,62,1: F-Line 126,1,65,1: F-Line 1,62,62,62: F-Line 126,62,65,62: If W:Then F-Line 62,1,62,62: F-Line 65,1,65,62: Else F-Line 62,1,62,Y-1: F-Line 65,1,65,Y-1: F-Line 62,Y-1,65,Y-1: F-Line 62,62,62,Y+G: F-Line 65,62,65,Y+G: F-Line 62,Y+G,65,Y+G: IfEnd F-Line 0,0,0,63: F-Line 0,0,60,0: F-Line 0,63,60,63: For 1->I To M Switch C[I] Case 0 WriteGraph X[I]/10,Y[I]/10,5,5,Mat W: Break Case 1 WriteGraph X[I]/10,Y[I]/10,5,5,Mat K: Break SwitchEnd Next If W:Then If W=1:Then (%-S)/128->T If T>=60:Then Sprintf("%dm%ds",%T/60,%MOD(T,60))->Str 1 Else Sprintf("%dsec",%T)->Str 1 IfEnd IfEnd If W>70:Then LocateYX 16,12,"You won in": LocateYX 16,78,Str 1: LocateYX 24,12,"Do you want more?": LocateYX 32,36,"Press EXE": If K=31:Then 'EXE M+N->M %->S 0->W For 1->I To M RanInt#(0,1)->C[I] Next IfEnd Else Isz W IfEnd IfEnd ' fps display Isz F If %-R>=128:Then F->P 0->F %->R IfEnd Text 0,0,P ' _PutDispDD_ ' fps control ' _While _%-C<3 ' _WhileEnd_ LpWhile K<>47:'EXIT ' ---end---